@yangzw/bruce-img
Version:
An image processing tool that multifunctional and unrestricted
1 lines • 1.05 kB
JavaScript
var x=this&&this.__awaiter||function(n,o,t,e){return new(t||(t=Promise))((function(i,r){function s(n){try{a(e.next(n))}catch(n){r(n)}}function c(n){try{a(e.throw(n))}catch(n){r(n)}}function a(n){var o;n.done?i(n.value):(o=n.value,o instanceof t?o:new t((function(n){n(o)}))).then(s,c)}a((e=e.apply(n,o||[])).next())}))};import{writeFileSync as st}from"node:fs";import{exit as s}from"node:process";import{AbsPath as E,CreateDir as ns,RemoveDir as eo,WaitFor as Ze}from"@yangzw/bruce-us/dist/node.js";import no from"ora";import{SCAN_TEXT as t$}from"../langs/index.js";import{OUTPUT_DIR as ai,FilterImg as pi,ShowTitle as io}from"../utils/index.js";export default function Ro(){return x(this,void 0,void 0,(function*(){io("scan");const n=no(t$.doing).start();eo(ai.scan),ns(ai.scan);const{count:o,invalidImgs:t}=yield pi(),e=t.sort().reduce(((n,o,t,e)=>n+=`${o}${t<e.length-1?"\n":""}`),"");st(E(`./${ai.scan}/scan.txt`),e,"utf8"),yield Ze(2e3),n.stop(),console.log(t$.stats(o)),t.length<=100&&t.forEach((n=>console.log(n))),console.log(t$.done),s(1)}))}