main段指定了加载的入口文件bin指定各内部命令对应的可执行文件的位置"bin": {"someTool": "./bin/someTool.js"}
-
"scripts": {"preinstall": "echo here it comes!","postinstall": "echo there it goes!","start": "node index.js","test": "tap test/*.js"}
preferGlobal用户未将该模块全局安装时,要不要显示警告bugs{"url" : "https://github.com/owner/project/issues","email" : "project@hostname.com"}
files
数组,写法与.gitignore一样,但是代表的是哪些文件会在publish的时候被打入tarball可以是目录或文件
以下文件默认会被包含在内,不受配置影响package.json / README / CHANGES / CHANGELOG / HISTORY / LICENSE / LICENCE / NOTICE / The file in the “main” field
注:
files配置优先级比.npmignore和.gitignore都高publishConfig发布相关配置
例如你希望发布到内部网络的 npm 仓库中"publishConfig": {"registry": "http://localhost/repository/npm-hosted/"}
directories目前没什么用
