完整的package.json


{
“name”: “Hello World”, //name属性就是你的模块名称
“version”: “0.0.1”, //version必须可以被npm依赖的一个node-semver模块解析
“author”: “张三”, //"author"是一个码农
“description”: “第一个node.js程序”, //一个描述,方便别人了解你的模块作用,搜索的时候也有用。
“mian”:“index.js”, //main属性指定了程序的主入口文件.
“keywords”:[“node.js”,“javascript”], //一个字符串数组,方便别人搜索到本模块
“repository”: { //指定一个代码存放地址,对想要为你的项目贡献代码的人有帮助。
“type”: “git”,
“url”: “https://path/to/url”
},
“license”:“MIT”, //你应该为你的模块制定一个协议,让用户知道他们有何权限来使用你的模块,以及使用该模块有哪些限制,如BSD-3-Clause 或 MIT之类的协议
“engines”: {“node”: “0.10.x”},
“bugs”:{ //填写一个bug提交地址或者一个邮箱,被你的模块坑到的人可以通过这里吐槽
“url”:“https://github.com/luoshushu”,
“email”:“bug@example.com”
},
“contributors”:[{“name”:“李四”,“email”:“lisi@example.com”}], // "contributors"是一个码农数组。
“scripts”: { //指定了运行脚本命令的npm命令行缩写。比如:输入npm run start时,所要执行的命令是node index.js。
“start”: “node index.js”
},
“dependencies”: { //指定了项目运行所依赖的模块
“express”: “latest”,
“mongoose”: “~3.8.3”,
“handlebars-runtime”: “~1.0.12”,
“express3-handlebars”: “~0.5.0”,
“MD5”: “~1.2.0”
},
“devDependencies”: { //指定项目开发所需要的模块
“bower”: “~1.2.8”,
“grunt”: “~0.4.1”,
“grunt-contrib-concat”: “~0.3.0”,
“grunt-contrib-jshint”: “~0.7.2”,
“grunt-contrib-uglify”: “~0.2.7”,
“grunt-contrib-clean”: “~0.5.0”,
“browserify”: “2.36.1”,
“grunt-browserify”: “~1.3.0”,
}
}

posted @ 2019-08-23 16:06  星河入梦  阅读(93)  评论(0编辑  收藏  举报