xgqfrms-GitHub / Node-CLI-Tools

一个 Node.js CLI 工具,查看指定 git 仓库的 commit history ; 能对 commit history 进行搜索; 能查看指定时间范围的 commit history.
https://node-cli-tools.xgqfrms.xyz
MIT License
6 stars 2 forks source link

blogs #2

Closed xgqfrms-GitHub closed 7 years ago

xgqfrms-GitHub commented 7 years ago

blogs

https://medium.freecodecamp.com/writing-command-line-applications-in-nodejs-2cf8327eee2

xgqfrms-GitHub commented 7 years ago

node-in-action

CLI

https://sfantasy.gitbooks.io/node-in-action/content/zh/cli/

ginit

https://www.sitepoint.com/javascript-command-line-interface-cli-node-js/

https://github.com/sitepoint-editors/ginit

https://developer.atlassian.com/blog/2015/11/scripting-with-node/

http://javascriptplayground.com/blog/2015/03/node-command-line-tool/

list files and directories

Our goal will be to write a CLI app to list files and directories.

我们的目标是编写一个CLI应用程序来列出文件和目录

https://medium.freecodecamp.com/writing-command-line-applications-in-nodejs-2cf8327eee2

xgqfrms-GitHub commented 7 years ago

https://www.jonathanfielding.com/cli-tool-using-node/

https://www.jonathanfielding.com/writing-a-command-line-utility-using-node/

http://javascriptplayground.com/blog/2012/08/writing-a-command-line-node-tool/

xgqfrms-GitHub commented 7 years ago

npm link

#!/usr/bin/env node

var program = require('commander');

console.log('Node CLI');

program.version('1.1.1').parse(process.argv);

console.log('Node CLI', process.argv[0]);

console.log('Node CLI', process.argv[1]);

console.log('Node CLI', process.argv[2]);
{
    "name": "hello",
    "bin": {
        "hello": "hello",
        "nc": "nodecli"
    },
    "dependencies": {
        "commander": "^2.9.0"
    }
}
$ npm link
$ nc

https://segmentfault.com/a/1190000008714075

http://visionmedia.github.io/superagent/

http://npm.taobao.org/package/cli-table2

https://juejin.im/entry/58f41ccd61ff4b0058fc64f8

xgqfrms-GitHub commented 7 years ago

node-cli-extended-name(must)

not exactly, just set #!/usr/bin/env node

node-cli-extended-name must

node-cli-extended-error

xgqfrms-GitHub commented 7 years ago

https://xdlrt.github.io/2017/04/15/2017-04-15/

https://github.com/sendgrid/sendgrid-nodejs

https://www.smashingmagazine.com/2017/03/interactive-command-line-application-node-js/

xgqfrms-GitHub commented 7 years ago

http://binbinliao.com/programming/commandline-nodejs.html

https://aotu.io/notes/2015/12/23/building-command-line-tools-with-node-js/index.html

https://developer.atlassian.com/blog/2015/11/scripting-with-node/

xgqfrms-GitHub commented 7 years ago

#!/usr/bin/env node

npm link error ???

#!/usr/bin/env node

https://github.com/xgqfrms-GitHub/Node-CLI-Tools/issues/2

https://node-cli-tools.xgqfrms.xyz/

npm link lost #!/usr/bin/env node

#!/usr/bin/env node

C:\Users\xray\AppData\Roaming\npm-cache_logs\2017-06-11T18_24_42_614Z-debug.log

xgqfrms-GitHub commented 7 years ago

https://github.com/xgqfrms-GitHub/Node-CLI-Tools/wiki/npm-link

xgqfrms commented 5 years ago

https://www.npmjs.com/package/request

https://sfantasy.gitbooks.io/node-in-action/content/zh/cli/request.html

var colors = require('colors');

https://www.npmjs.com/package/colors

color

image

if (type && types.includes(type)) {
    // generator files
} else {
    // console.error(`unknown type`, type);
    // color
    console.log(`unknown type`.bgBlack.magenta.bold.italic, `"` + `${type}`.red.underline + `"`);
    console.log(`for more details, click link:`.bgGreen.black, `https://github.com/Marak/colors.js`.green);
}
xgqfrms commented 5 years ago

https://www.sitepoint.com/javascript-command-line-interface-cli-node-js/

image