推荐关注
Meteor
JSLint - a JavaScript code quality tool
jsFiddle
D3.js
WebStorm
推荐书目
JavaScript 权威指南第 5 版
Closure: The Definitive Guide
inpm

集成一个外部指令到 npm package 里

  •  
  •   inpm · Dec 20, 2017 · 2569 views
    This topic created in 3086 days ago, the information mentioned may be changed or developed.

    我想集成一个外部命令在我的 npm package 里面,Just like this : xxx init,xxx login

    1 replies    2017-12-22 16:48:55 +08:00
    flowfire
        1
    flowfire  
       Dec 22, 2017   ❤️ 1
    比如你想让 test init 调用 index.js
    就在 package.json 里加上
    "bin": {
    "test": "index.js"
    }

    然后发布到 npm 上。这样别人如果用 -g 参数安装你的模块,就可以使用 test 命令调用 index.js 文件

    如果你想在本地测试,使用
    npm link
    命令把本地的包软连接到全局即可
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3386 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 11:12 · PVG 19:12 · LAX 04:12 · JFK 07:12
    ♥ Do have faith in what you're doing.