calc-common
v0.2.3
Published
calc front-end common modules
Downloads
2
Readme
1>相关文章
npm官网
nodejs官网
nvm介绍及使用
发布一个npm包,构建自己的第三方库
如何创建自己的npm包
npm包的介绍、前端实现自己的包并上传到npm仓库的方法
上传npm包
使用webpack构建属于你自己的npm包
记npm包开发全过程
创建自己的library类库包并使用webpack4.x打包发布到npm
webpack4与babel配合使es6代码可运行于低版本浏览器
webpack发布npm-package
2>常用命令
npm
npm install webpack webpack-cli --global
(全局安装插件)
=>npm install webpack webpack-cli -g
npm install calc-common
(只在dependencies安装)
npm install --save calc-common
(只在dependencies安装)
npm install --save-dev calc-common
(devDependencies安装)
=>npm install -D
npm i --save-dev [email protected]
(安装指定版本的包)
npm uninstall calc-common
(卸载包)
删除 node_modules 依赖
npm install rimraf -g
rimraf node_modules
npm init
(初始化自定义包的环境)
npm config get registry
(查看镜像地址)
npm login
(登录npm账号)
npm adduser
(创建npm账号)
npm publish
(上传发布)
npm version patch
(更新版本)
npm unpublish 包名@版本号
(删除指定的版本)
npm unpublish 包名 --force
(删除整个包, 会有警告提示, 删除后该包名24小时之内不可再用)
npm audit --json
(查看需要手动更新的漏洞)
nvm
nvm ls-remote
:列出所有可以安装的node版本号
nvm ls
:列出所有已经安装的node版本
nvm install v10.4.0
:安装指定版本号的node
nvm current
:当前node版本
nvm use v10.3.0
:切换node的版本,这个是全局的
3>其他知识点
*dependencies
(生产依赖): 如果某些包在开发和项目上线之后都需要用到,则建议把这些包记录到 dependencies 节点中。
*devDependencies
(开发依赖): 如果某些包只在项目开发阶段会用到,在项目上线之后不会用到,则建议把这些包记录到devDependencies 节点中。
*如何仅仅安装生产依赖?
默认npm install 会安装所有依赖(开发和生产依赖都安装)
通过–production 选项可以仅仅安装生产依赖
npm install --production