天天看點

【Vue 開發實戰】拓展篇 # 47:如何釋出元件到npm以及nrm的介紹

說明

【Vue 開發實戰】學習筆記。

釋出到npm

具體可以參考我的這篇文章:怎麼将自己寫的庫釋出到npm上面?

這裡具體介紹一下 nrm的使用

什麼是 nrm

​​https://github.com/Pana/nrm​​

nrm 可以幫助您輕松快速地在不同的NPM系統資料庫之間切換,現在包括:NPM, cnpm,taobao,nj(nodejitsu)。

npm install      

使用 ​

​nrm ls​

​ 可以檢視注冊清單

nrm ls      
【Vue 開發實戰】拓展篇 # 47:如何釋出元件到npm以及nrm的介紹
nrm use cnpm      
Usage: nrm [options] [command]

  Commands:

    ls                                    List all the registries
    current                               Show current registry name
    use <registry>                        Change registry to registry
    add <registry> <url> [home]           Add one custom registry
    login <registry> [value]              Set authorize information for a registry with a base64 encoded string or username and pasword
      -a  --always-auth                     Set is always auth
      -u  --username <username>             Your user name for this registry
      -p  --password <password>             Your password for this registry
      -e  --email <email>                   Your email for this registry
    set-hosted-repo <registry> <value>    Set hosted npm repository for a custom registry to publish packages
    set-scope <scopeName> <value>         Associating a scope with a registry
    del-scope <scopeName>                 Remove a scope
    set <registryName>                    Set custom registry attribute
      -a  --attr <attr>                    Set custorm registry attribute
      -v  --value <value>                  Set custorm registry value
    del <registry>                        Delete one custom registry
    rename <registryName> <newName>       Set custom registry name
    home <registry> [browser]             Open the homepage of registry with optional browser
    publish [<tarball>|<folder>]          Publish package to current registry if current registry is a custom registry. The field 'repository' of current custom registry is required running this command. If you're not using custom registry, this command will run npm publish directly
      -t  --tag [tag]                        Add tag
      -a  --access <public|restricted>       Set access
      -o  --otp [otpcode]                    Set otpcode
      -dr --dry-run                          Set is dry run
    test [registry]                       Show the response time for one or all registries
    help                                  Print this help