分类: Web开发
2017-08-05 23:30:55
以,创建过程为例,讲解整个NPM包创建和发布流程
MIT License Copyright (c)Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
markdown-clear ------------- .gitignore ------------- LICENCE ------------- README.md ------------- package.json
跨编辑器的编辑器设置,网站挂了,
新一代JavaScript代码质量检测工具
markdown-clear -------------- src // 源代码目录 比如coffee,typescript,es6+等代码的目录 -------------- lib // 转义生成的代码目录,比如babel转义后的es5代码的目录 -------------- docs // 代码相关的设计和使用文档 -------------- tests // 相关的测试目录
{ "presets":["es2015","stage-0"] }
"scripts": { "build": "babel src -d lib", }2.2.2 实现一个可以全局安装的npm包
"bin": { "markdown-clear": "./lib/cli.js" }
#!/usr/bin/env node
npm install path/to/markdown-clear
npm install path/to/markdown-clear -g
npm adduser USERNAME
npm login
npm publish