@vighnesh153/ftp-server
Advanced tools
Comparing version 0.4.0-alpha-06 to 0.4.0-alpha-07
@@ -12,2 +12,2 @@ #!/usr/bin/env node | ||
var p="__vighnesh153-ftp-client__",d=7878,m=".",f=i.join(p,"index.html");function s(u){return !u}function A(){return i.dirname(fileURLToPath(import.meta.url))}function D(u){return a.existsSync(u)}function E(u){return a.existsSync(u)&&a.lstatSync(u).isDirectory()}function g(u){return s(E(u))?[]:a.readdirSync(u).map(e=>{let r=i.resolve(u,e);return {name:e,type:E(r)?"directory":"file"}})}function C(u){let{directoryPath:t,port:e}=u;return ()=>{console.log(`Directory: ${i.resolve(t)}`),console.log(`Server is listening on port ${e}`),console.log(`On this machine: http://localhost:${e}/`),console.log(`On local network: http://${k.address()}:${e}/`);}}function F(u){let{port:t}=u;return e=>{if(e.code==="EADDRINUSE"){console.log(),console.log(e),console.log(),console.log(y.red(`Port ${t} already in use!`)),console.log("Please try with a different port. eg. --port=4200"),process.exit(1);return}throw e}}function v(){return B.static(A(),{immutable:!0,maxAge:"30000"})}function b(u){return (t,e,r)=>{let o=i.resolve(u,t.path.slice(1));if(D(o)){r();return}e.status(404).json({message:`This path is invalid: ${o}`});}}function O(u){return (t,e)=>{let r=i.resolve(u,`${t.query.path}`.slice(1)),o=i.basename(r),n=L("zip");n.on("end",()=>{console.log(y.green(`${n.pointer()} total bytes`));}),n.on("error",c=>{e.status(500).send({error:c});}),e.attachment(`${o}.zip`),n.pipe(e),n.directory(r,o),n.finalize().then(()=>{console.log(y.yellow("/zip: Configuration complete"));});}}function S(u){return (t,e,r)=>{let o=i.resolve(u,t.path.slice(1));if(s(E(o))){r();return}let c=a.readFileSync(i.resolve(A(),f),{encoding:"utf-8"}).replace("__REPLACEMENT__",JSON.stringify(g(o)));e.send(c);}}function x(){return (u,t)=>{t.status(405).json({message:`Method "${u.method}" is not allowed. Supported method is "GET"`});}}function R(u){return B.static(u,{dotfiles:"allow",setHeaders:t=>{t.setHeader("content-type","application/octet-stream");}})}function T(u){let{port:t,directoryPath:e}=u,r=B();r.use(H("tiny")),r.get(`/${p}*`,v()),r.get("/zip",O(e)),r.get("*",b(e)),r.get("*",S(e)),r.get("*",R(e)),r.use(x()),r.listen(t,C({directoryPath:e,port:t})).on("error",F({directoryPath:e,port:t}));}var l={name:"@vighnesh153/ftp-server",version:"0.4.0-alpha-06",description:"A simple ftp server cli tool for your local files",license:"MIT",type:"module",main:"./dist/cli.js",bin:"./dist/cli.js",private:!1,author:{name:"Vighnesh Raut",url:"https://vighnesh153.com",email:"me@vighnesh153.com"},publishConfig:{access:"public"},repository:{type:"git",url:"git@github.com:vighnesh153/vighnesh153-turbo.git"},scripts:{dev:"echo TODO","dev:backend":"tsup --watch","dev:frontend":"vite",copy:"cpy --cwd=./src/client/dist . ../../../dist/__vighnesh153-ftp-client__/",build:"tsup && vite build && npm run copy"},files:["dist","README.md"],dependencies:{archiver:"^5.3.1",chalk:"^5.2.0",commander:"^10.0.0",ejs:"^3.1.8",express:"^4.18.2",ip:"^2.0.0",morgan:"^1.10.0"},devDependencies:{"@emotion/react":"^11.10.6","@emotion/styled":"^11.10.6","@mui/material":"^5.11.11","@types/archiver":"^5.3.1","@types/express":"^4.17.17","@types/ip":"^1.1.0","@types/morgan":"^1.9.4","@types/node":"*","@types/react":"^18.0.27","@types/react-dom":"^18.0.10","@vighnesh153/tsconfig":"*","@vighnesh153/utils":"*","@vitejs/plugin-react":"^3.1.0","cpy-cli":"^4.2.0","eslint-config-vighnesh153":"*",react:"^18.2.0","react-dom":"^18.2.0",typescript:"^4.9.5",vite:"^4.1.0"},keywords:["ftp","file-transfer-protocol","server","serve","directory","local","localhost","network","vighnesh153","file","transfer","protocol"]};var w=new Command;w.name(l.name).description(l.description).version(l.version).option("-p, --port <port>","port number for the ftp server",`${d}`).option("-d, --directory <path-to-directory>","directory to be served",`${m}`).parse();var Y=w.opts(),{port:q,directory:Z}=Y,J=parseInt(`${q}`,10);T({port:J,directoryPath:Z}); | ||
var p="__vighnesh153-ftp-client__",d=7878,m=".",f=i.join(p,"index.html");function s(u){return !u}function A(){return i.dirname(fileURLToPath(import.meta.url))}function D(u){return a.existsSync(u)}function E(u){return a.existsSync(u)&&a.lstatSync(u).isDirectory()}function g(u){return s(E(u))?[]:a.readdirSync(u).map(e=>{let r=i.resolve(u,e);return {name:e,type:E(r)?"directory":"file"}})}function C(u){let{directoryPath:t,port:e}=u;return ()=>{console.log(`Directory: ${i.resolve(t)}`),console.log(`Server is listening on port ${e}`),console.log(`On this machine: http://localhost:${e}/`),console.log(`On local network: http://${k.address()}:${e}/`);}}function F(u){let{port:t}=u;return e=>{if(e.code==="EADDRINUSE"){console.log(),console.log(e),console.log(),console.log(y.red(`Port ${t} already in use!`)),console.log("Please try with a different port. eg. --port=4200"),process.exit(1);return}throw e}}function v(){return B.static(A(),{immutable:!0,maxAge:"30000"})}function b(u){return (t,e,r)=>{let o=i.resolve(u,t.path.slice(1));if(D(o)){r();return}e.status(404).json({message:`This path is invalid: ${o}`});}}function O(u){return (t,e)=>{let r=i.resolve(u,`${t.query.path}`.slice(1)),o=i.basename(r),n=L("zip");n.on("end",()=>{console.log(y.green(`${n.pointer()} total bytes`));}),n.on("error",c=>{e.status(500).send({error:c});}),e.attachment(`${o}.zip`),n.pipe(e),n.directory(r,o),n.finalize().then(()=>{console.log(y.yellow("/zip: Configuration complete"));});}}function S(u){return (t,e,r)=>{let o=i.resolve(u,t.path.slice(1));if(s(E(o))){r();return}let c=a.readFileSync(i.resolve(A(),f),{encoding:"utf-8"}).replace("__REPLACEMENT__",JSON.stringify(g(o)));e.send(c);}}function x(){return (u,t)=>{t.status(405).json({message:`Method "${u.method}" is not allowed. Supported method is "GET"`});}}function R(u){return B.static(u,{dotfiles:"allow",setHeaders:t=>{t.setHeader("content-type","application/octet-stream");}})}function T(u){let{port:t,directoryPath:e}=u,r=B();r.use(H("tiny")),r.get(`/${p}*`,v()),r.get("/zip",O(e)),r.get("*",b(e)),r.get("*",S(e)),r.get("*",R(e)),r.use(x()),r.listen(t,C({directoryPath:e,port:t})).on("error",F({directoryPath:e,port:t}));}var l={name:"@vighnesh153/ftp-server",version:"0.4.0-alpha-06",description:"A simple ftp server cli tool for your local files",license:"MIT",type:"module",bin:"./dist/cli.js",private:!1,author:{name:"Vighnesh Raut",url:"https://vighnesh153.com",email:"me@vighnesh153.com"},publishConfig:{access:"public"},repository:{type:"git",url:"git@github.com:vighnesh153/vighnesh153-turbo.git"},scripts:{dev:"echo TODO","dev:backend":"tsup --watch","dev:frontend":"vite",copy:"cpy --cwd=./src/client/dist . ../../../dist/__vighnesh153-ftp-client__/",build:"tsup && vite build && npm run copy"},files:["dist","README.md"],dependencies:{archiver:"^5.3.1",chalk:"^5.2.0",commander:"^10.0.0",ejs:"^3.1.8",express:"^4.18.2",ip:"^2.0.0",morgan:"^1.10.0"},devDependencies:{"@emotion/react":"^11.10.6","@emotion/styled":"^11.10.6","@mui/material":"^5.11.11","@types/archiver":"^5.3.1","@types/express":"^4.17.17","@types/ip":"^1.1.0","@types/morgan":"^1.9.4","@types/node":"*","@types/react":"^18.0.27","@types/react-dom":"^18.0.10","@vighnesh153/tsconfig":"*","@vighnesh153/utils":"*","@vitejs/plugin-react":"^3.1.0","cpy-cli":"^4.2.0","eslint-config-vighnesh153":"*",react:"^18.2.0","react-dom":"^18.2.0",typescript:"^4.9.5",vite:"^4.1.0"},keywords:["ftp","file-transfer-protocol","server","serve","directory","local","localhost","network","vighnesh153","file","transfer","protocol"]};var w=new Command;w.name(l.name).description(l.description).version(l.version).option("-p, --port <port>","port number for the ftp server",`${d}`).option("-d, --directory <path-to-directory>","directory to be served",`${m}`).parse();var Y=w.opts(),{port:q,directory:Z}=Y,J=parseInt(`${q}`,10);T({port:J,directoryPath:Z}); |
{ | ||
"name": "@vighnesh153/ftp-server", | ||
"version": "0.4.0-alpha-06", | ||
"version": "0.4.0-alpha-07", | ||
"description": "A simple ftp server cli tool for your local files", | ||
"license": "MIT", | ||
"type": "module", | ||
"main": "./dist/cli.js", | ||
"bin": "./dist/cli.js", | ||
@@ -9,0 +8,0 @@ "private": false, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
825509
2