npm

出错

使用 npm 报错
no_perms Private mode enable, only admin can publish this module
切换回原本的

1
$ npm config set registry http://registry.npmjs.org

登录

1
$ npm login

登录后查看当前用户名

1
$ npm whoami

发布

1
$ npm publish

更新

1
2
$ npm version 1.0.1
$ npm publish

安装、使用

1
$ npm install --save zero-webpack-numbers
1
2
import * as webpackNumbers from 'zero-webpack-numbers';
webpackNumbers.numToWord(1); // 'one'

插件

1、serve-favicon

1
$ npm install serve-favicon --save

1
2
var favicon = require('serve-favicon');
app.use(favicon(__dirname + '/favicon.ico'));