zhuhongyan / blog Goto Github PK
View Code? Open in Web Editor NEW朱洪岩的Blog
朱洪岩的Blog
CLI(command-line interface 命令行界面)是指在图形用户界面得到普及之前使用最为广泛的用户界面,
它通常不支持鼠标,用户通过键盘输入指令,计算机接收到指令后,予以执行。也有人称之为字符用户界面(CUI)。
进入开发目录执行 npm init
将会创建 package.json和默认的配置。当然手动创建也没有问题。
在package.js文件中,需要新增配置项
"bin":{
"node-cli": "bin/index.js"
}
其中node-cli是需要执行的命令名,bin/index.js是命令所调用的文件
可以在bin/index.js 写入
#!/usr/bin/env node // 指定脚本的解释程序为node
console.log('my cli')
在开发目录执行 npm link (创建软连接)
npm link命令通过链接目录和可执行文件,实现npm包命令的全局可执行。
这样我们可以在任何地方执行 node-cli命令
发布: 本地调试成功后,我们需要发布到npm上面
npm: URL
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.