xl1 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/jsd1/index.js +2 -2
- package/package.json +3 -1
package/dist/jsd1/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
|
-
"use strict";var _chunkKLMDRKHJjs = require('../chunk-KLMDRKHJ.js');require('../chunk-Y4GMOS4Y.js');require('../chunk-EJUO2FGU.js');var _chunkVPQQEJWQjs = require('../chunk-VPQQEJWQ.js');require('../chunk-KNGN2YR6.js');var _chunkNEJSZOZXjs = require('../chunk-NEJSZOZX.js');var
|
|
3
|
-
`;u.appendFileSync(d,
|
|
2
|
+
"use strict";var _chunkKLMDRKHJjs = require('../chunk-KLMDRKHJ.js');require('../chunk-Y4GMOS4Y.js');require('../chunk-EJUO2FGU.js');var _chunkVPQQEJWQjs = require('../chunk-VPQQEJWQ.js');require('../chunk-KNGN2YR6.js');var _chunkNEJSZOZXjs = require('../chunk-NEJSZOZX.js');var x=_chunkNEJSZOZXjs.b.call(void 0, (A,y)=>{var u=_chunkNEJSZOZXjs.a.call(void 0, "fs"),a=_chunkNEJSZOZXjs.a.call(void 0, "path"),k=_chunkNEJSZOZXjs.a.call(void 0, "axios"),$=_chunkNEJSZOZXjs.a.call(void 0, "marked"),j=_chunkNEJSZOZXjs.a.call(void 0, "glob"),W=_chunkNEJSZOZXjs.a.call(void 0, "https");async function v(t,n,p=!1){try{let d=await k({url:t,method:"GET",responseType:"stream",httpsAgent:new W.Agent({rejectUnauthorized:p})}),i=u.createWriteStream(n);return d.data.pipe(i),new Promise((h,m)=>{i.on("finish",h),i.on("error",m)})}catch(d){console.log("download error",t,n,d)}}async function E(t,n,p,d,i){let h=u.readFileSync(p,"utf-8"),m=$.lexer(h),w=o=>{let s=[];return o.forEach(e=>{e.type==="link"&&s.push(e),e.type==="table"&&e.rows.forEach(r=>{r.forEach(c=>{c.tokens&&(s=s.concat(w(c.tokens)))})}),e.tokens&&(s=s.concat(w(e.tokens))),e.items&&e.items.forEach(r=>{s=s.concat(w(r.tokens))})}),s};for(let o of w(m)){let s=[".mp3",".mp4",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".epub",".mobi",".zip",".rar",".7z",".tar",".gz"].find(e=>o.href.endsWith(e)||o.text.endsWith(e));if(o.type==="link"){let e=o.href;e.startsWith("https://github.com")&&e.includes("/blob/")&&(e=e.replace("github.com","raw.githubusercontent.com").replace("/blob/","/"));let r=a.basename(p).replace(".md",""),c=a.join(t,n,r);if(u.existsSync(c)||u.mkdirSync(c,{recursive:!0}),o.href.startsWith("https://www.slideshare.net")){let f=r+"_"+o.text.replace(/[<>:"/\\|?*\n\r]+/g,"_").replace(".pptx","").replace(".pdf","")+"_";_chunkKLMDRKHJjs.a.call(void 0, ).startDownloadSlideShare(o.href,c,f,["pptx","pdf"],!1)}else if(s){let f=r+"_"+o.text.replace(/[<>:"/\\|?*\n\r]+/g,"_").replace(s,"")+"_"+a.basename(decodeURIComponent(e));f.endsWith(s)||(f+=s);let b=a.join(c,f);if(!u.existsSync(b)&&(console.log(`Downloading ${e} to ${b}`),await v(e,b,i),d)){let g=new Date().toISOString(),q=`${n},${r},${f},${e},${g}
|
|
3
|
+
`;u.appendFileSync(d,q)}}else o.href.startsWith("https://qiita.com/")&&_chunkVPQQEJWQjs.a.call(void 0, ).qiitaDl(o.href,c,r+"_",null,!1)}}}function O(t){let n=t.docsDir||a.join(process.cwd(),"docs"),p=t.downloadDir||a.join(process.cwd(),"download");j.sync(`${n}/**/*.md`).forEach(i=>{let h=a.relative(n,i),m=a.dirname(h);E(p,m,i,t.csv,t.insecure).catch(console.error)})}var z={command:"*",describe:"jsd1",builder:{docs:{alias:"d",describe:"docs directory",demandOption:!1,default:"docs",type:"string"},output:{alias:"o",describe:"output directory",demandOption:!1,default:"download",type:"string"},csv:{alias:"c",describe:"csv log file",demandOption:!1,default:"output.csv",type:"string"},insecure:{alias:"k",describe:"allow insecure server connections",demandOption:!1,default:!1,type:"boolean"}},handler(t){(async()=>O({docsDir:t.docs,downloadDir:t.output,csv:t.csv,insecure:!t.insecure}))()}};y.exports=z});var F=()=>{let t=_chunkNEJSZOZXjs.a.call(void 0, "yargs").scriptName("jsd1");t.command(x());let n=t.parse()};F();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xl1",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "just some xlsx script.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"bash1": "dist/bash1/index.js",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"jsd1": "dist/jsd1/index.js",
|
|
12
12
|
"jsss": "dist/jsss/index.js",
|
|
13
13
|
"qidl": "dist/qidl/index.js",
|
|
14
|
+
"scan-dir": "dist/scan-dir/index.js",
|
|
14
15
|
"ssdl": "dist/ssdl/index.js",
|
|
15
16
|
"xl1": "dist/xl1/index.js"
|
|
16
17
|
},
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
"pptxgenjs": "^3.12.0",
|
|
41
42
|
"puppeteer": "^24.1.1",
|
|
42
43
|
"sharp": "^0.33.5",
|
|
44
|
+
"sqlite3": "^5.1.7",
|
|
43
45
|
"ts-stdin": "^1.0.1",
|
|
44
46
|
"winston": "^3.17.0",
|
|
45
47
|
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz",
|