package.json详解
2021-07-02 15:08:16 7 举报
AI智能生成
简单介绍package.json各配置项
作者其他创作
大纲/内容
{
"name": "Hello World",
"version": "0.0.1",
"author": "张三",
"description": "node.js程序",
"keywords":["node.js","javascript"],
"repository": {
"type": "git",
"url": "https://path/to/url"
},
"license":"MIT",
"engines": {"node": "0.10.x"},
"bugs":{"url":"http://path/to/bug","email":"bug@example.com"},
"contributors":[{"name":"李四","email":"lisi@example.com"}],
"scripts": {
"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",
}
}
"name": "Hello World",
"version": "0.0.1",
"author": "张三",
"description": "node.js程序",
"keywords":["node.js","javascript"],
"repository": {
"type": "git",
"url": "https://path/to/url"
},
"license":"MIT",
"engines": {"node": "0.10.x"},
"bugs":{"url":"http://path/to/bug","email":"bug@example.com"},
"contributors":[{"name":"李四","email":"lisi@example.com"}],
"scripts": {
"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",
}
}
name:项目名称
version:项目版本
description:项目描述
keywords:关键词,方便npm search搜索被找到
bugs:项目便于跟踪或发布问题的地址
scripts:运行脚本命令的npm命令行缩写
dependencies:项目运行依赖的模块
bundleDependencies:项目发布所需依赖
devDependencies:项目开发所依赖的模块
peerDependencies:用来供插件指定其所需要的主工具的版本
bin:指定各个内部命令对应的可执行文件的位置
main:指定加载的入口文件
config:用于添加命令行的环境变量
其他
author:项目创建者、作者
contributors:项目参与者、贡献者
repository:项目仓库,方便想参与项目开发人员共同开发
directories:对整个代码结构的描述
files:数组,下载安装完成时包括的所有文件
homepage:项目主页url
browser:指定浏览器使用版本
engines:指明模块运行平台
man:指定当前模块的man文档的位置
preferGlobal:布尔值,表示当用户不将该模块安装为全局模块时,要不要显示警告,表示该模块的本意就是安装为全局模块
style:指定样式文件位置
license:项目开源证书
0 条评论
下一页