@abraham/pkg-ok 中文文档教程

发布于 3年前 浏览 23 项目主页 更新于 3年前

pkg-ok Build statusnpm

pkg-ok 在发布之前检查 package.json 中定义的路径和脚本 ????

  • Ensures paths defined in main, bin, module, types, typings, es2015 and browser exist
  • Ensures bin scripts use cross-platform line endings

这是 typicode/pkg-ok 的现代化分支。

Usage

npm install @abraham/pkg-ok --save-dev
// package.json
{
  "main": "oops_this_file_doesnt_exist.js",
  "scripts": {
    "prepublishOnly": "... && pkg-ok"
  }
}
npm publish
# Error!
# Since main file doesn't exist, publish is blocked

Options

pkg-ok< /code> 可以配置为检查额外的 package.json 字段或 bin 文件

pkg-ok --field someField --bin script.sh

API

const pkgDirectory = __dirname

pkgOk(pkgDirectory, {
  fields: ['someAdditonalField'],
  bin: ['someAdditionalScript.sh']
})

License

MIT

pkg-ok Build statusnpm

pkg-ok checks paths and scripts defined in package.json before you publish ????

  • Ensures paths defined in main, bin, module, types, typings, es2015 and browser exist
  • Ensures bin scripts use cross-platform line endings

This is a modernized fork of typicode/pkg-ok.

Usage

npm install @abraham/pkg-ok --save-dev
// package.json
{
  "main": "oops_this_file_doesnt_exist.js",
  "scripts": {
    "prepublishOnly": "... && pkg-ok"
  }
}
npm publish
# Error!
# Since main file doesn't exist, publish is blocked

Options

pkg-ok can be configured to check additional package.json fields or bin files

pkg-ok --field someField --bin script.sh

API

const pkgDirectory = __dirname

pkgOk(pkgDirectory, {
  fields: ['someAdditonalField'],
  bin: ['someAdditionalScript.sh']
})

License

MIT

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文