{"name":"egg-bin","version":"4.17.0-beta1","author":{"url":"https://fengmk2.com","name":"fengmk2","email":"fengmk2@gmail.com"},"_id":"egg-bin@4.17.0-beta1","maintainers":[{"name":"eggjs-admin","email":"fengmk2+eggjs@gmail.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"atian25","email":"atian25@qq.com"},{"name":"dead_horse","email":"dead_horse@qq.com"},{"name":"popomore","email":"sakura9515@gmail.com"},{"name":"wanghx","email":"whxaxes@gmail.com"},{"name":"hyj1991","email":"yeekwanvong@gmail.com"},{"name":"thonatos","email":"thonatos.yang@gmail.com"},{"name":"killagu","email":"killa07071201@gmail.com"},{"name":"coolme200","email":"2001-wms@163.com"},{"name":"xadillax","email":"admin@xcoder.in"},{"name":"ngot","email":"zhuanghengfei@gmail.com"},{"name":"mansonchor.zzw","email":"mansonchor1987@gmail.com"},{"name":"hubcarl","email":"hubcarl@126.com"}],"contributors":[{"url":"https://fengmk2.com","name":"fengmk2","email":"fengmk2@gmail.com"}],"homepage":"https://github.com/eggjs/egg-bin","bugs":{"url":"https://github.com/eggjs/egg-bin/issues"},"ci":{"version":"6, 8"},"bin":{"ets":"bin/ets.js","mocha":"bin/mocha.js","egg-bin":"bin/egg-bin.js"},"bug":{"url":"https://github.com/eggjs/egg/issues"},"dist":{"shasum":"4944716cfbb739677583859f81ee4a1d238c2224","tarball":"http://registry-npm.ywwl.com/egg-bin/download/egg-bin-4.17.0-beta1.tgz","fileCount":17,"integrity":"sha512-2538//9dsXSRPj9PDe5R8yckvZJtuDhU7FO8IsnoZ7WHf2+t9hp5emqQm2aPt+2Y31XDJL9w/EHW0Y0rh+aLiA==","signatures":[{"sig":"MEUCIQCXV153rrBKgN/KBkK1tlZFHK7zfeXBX+hCNI0x06H9OQIgOyw9TT0tW0ndifG8LM3ioC68d8+s7YWNH9GWNaOT2k0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":34726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4o6GCRA9TVsSAnZWagAAc8QP/RQrJ5bge4snrC/JPIDY\nRE2nofLA5A+ixc0sWOgYFTvoWQoO6GpimT9WEL/pcjMJz1u2R5/hCx4fVjjR\nLQYFgPVE08BLmeWQeCtStL09cMwJCj4VXh5sUwB8b8kHiNyoGcyMif+r1ene\nPI9t3591PO2xGSJrh+r1Kyf9RuhyXP2TQOkrww8BQlZHigmF0tqR3oQEXuoH\n4gCOWkBaR83qBUZrMg3Viyp7DMv9McAvF6mJxUE1O02lPKLDKqACSt6cMrDW\nJshLP2hCCsgqT6wktCHBERtCrgMX9+aMP4T1XWdvhBv660PgpeS+9aq7NXl6\nJhl72QAlsgkKo42xLEQpZcH7zRRbo/I2q6swn7eAfm1SHOzUEcx2DylCpx5k\n6nfZqcM28ssWMbMRSWjeBLRudpYtsNQ4R6aEqEsx7KxXGwcDzuLrfRqyfpX8\nfEAByRj/YmRZpFCdqWlh6jKKX5gq072UfV79mPtAV00Ftt95FEDrFVEvzG7c\ngPYqj++tN1+83Y3SC9y1/reDxM//+wgWQkteosOzzkheIFvh/ZPcH9Tgz24Z\nykxWrW213lOnXRbgJVaeHM9mYrS9CmPuIKx2xmtQ3l6u1jYqe05s1nbVIliB\nQHJwT4vdtEcvfLYjXWD0gqsKZ631DEmFI5fmZwBIfLAmveXT6ExsZhOWK+b5\nnucl\r\n=o1iM\r\n-----END PGP SIGNATURE-----\r\n","size":10864,"noattachment":false,"key":"/egg-bin/-/egg-bin-4.17.0-beta1.tgz"},"main":"index.js","readme":"# egg-bin\n\n[![NPM version][npm-image]][npm-url]\n[![build status][github-actions]][github-actions-url]\n[![Test coverage][codecov-image]][codecov-url]\n[![David deps][david-image]][david-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n[![npm download][download-image]][download-url]\n\n[npm-image]: https://img.shields.io/npm/v/egg-bin.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/egg-bin\n[github-actions]: https://github.com/eggjs/egg-bin/actions/workflows/linux-14.yml/badge.svg?branch=master\n[github-actions-url]: https://github.com/eggjs/egg-bin/actions/workflows/linux-14.yml\n[codecov-image]: https://codecov.io/gh/eggjs/egg-bin/branch/master/graph/badge.svg\n[codecov-url]: https://codecov.io/gh/eggjs/egg-bin\n[david-image]: https://img.shields.io/david/eggjs/egg-bin.svg?style=flat-square\n[david-url]: https://david-dm.org/eggjs/egg-bin\n[snyk-image]: https://snyk.io/test/npm/egg-bin/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/egg-bin\n[download-image]: https://img.shields.io/npm/dm/egg-bin.svg?style=flat-square\n[download-url]: https://npmjs.org/package/egg-bin\n\n\negg developer tool, extends [common-bin].\n\n---\n\n## Install\n\n```bash\n$ npm i egg-bin --save-dev\n```\n\n## Usage\n\nAdd `egg-bin` to `package.json` scripts:\n\n```json\n{\n  \"scripts\": {\n    \"dev\": \"egg-bin dev\",\n    \"debug\": \"egg-bin debug\",\n    \"test-local\": \"egg-bin test\",\n    \"test\": \"npm run lint -- --fix && npm run test-local\",\n    \"cov\": \"egg-bin cov\",\n    \"lint\": \"eslint .\",\n    \"pkgfiles\": \"egg-bin pkgfiles\",\n    \"autod\": \"egg-bin autod\",\n    \"ci\": \"npm run lint && npm run autod -- --check && npm run pkgfiles -- --check && npm run cov\"\n  }\n}\n```\n\n## Command\n\nAll the commands support these specific v8 options:\n\n- `--debug`\n- `--inspect`\n- `--harmony*`\n- `--es_staging`\n\n```bash\n$ egg-bin [command] --debug --es_staging\n```\n\nif `process.env.NODE_DEBUG_OPTION` is provided (WebStorm etc), will use it as debug options.\n\n### dev\n\nStart dev cluster on `local` env, it will start a master, an agent and a worker.\n\n```bash\n$ egg-bin dev\n```\n\n##### options\n\n- `--framework` egg web framework root path.\n- `--baseDir` application's root path, default to `process.cwd()`.\n- `--port` server port, default to `7001`.\n- `--workers` worker process number, default to `1` worker at local mode.\n- `--sticky` start a sticky cluster server, default to `false`.\n- `--typescript` / `--ts` enable typescript support, default to `false`. Also support read from `package.json`'s `egg.typescript`.\n- `--declarations` / `--dts` enable [egg-ts-helper](https://github.com/whxaxes/egg-ts-helper) support, default to `false`. Also support read from `package.json`'s `egg.declarations`.\n- `--require` will add to `execArgv`, support multiple. Also support read from `package.json`'s `egg.require`\n\n### debug\n\nDebug egg app with [V8 Inspector Integration](https://nodejs.org/api/debugger.html#debugger_v8_inspector_integration_for_node_js).\n\nautomatically detect the protocol, use the new `inspector` when the targeted runtime >=7.0.0 .\n\nif running without `VSCode` or `WebStorm`, we will use [inspector-proxy](https://github.com/whxaxes/inspector-proxy) to proxy worker debug, so you don't need to worry about reload.\n\n```bash\n$ egg-bin debug --debug-port=9229 --proxy=9999\n```\n\n##### options\n\n- all `egg-bin dev` options is accepted.\n- `--proxy=9999` worker debug proxy port.\n\n\n### test\n\nUsing [mocha] with [co-mocha] to run test.\n\n[power-assert] is the default `assert` library, and [intelli-espower-loader] will be auto required.\n\n```bash\n$ egg-bin test [files] [options]\n```\n\n- `files` is optional, default to `test/**/*.test.js`\n- `test/fixtures`, `test/node_modules` is always exclude.\n\n#### auto require `test/.setup.js`\n\nIf `test/.setup.js` file exists, it will be auto require as the first test file.\n\n```js\ntest\n  ├── .setup.js\n  └── foo.test.js\n```\n\n#### options\n\nYou can pass any mocha argv.\n\n- `--require` require the given module\n- `--grep` only run tests matching <pattern>\n- `--timeout` milliseconds, default to 60000\n- `--full-trace` display the full stack trace, default to false.\n- `--typescript` / `--ts` enable typescript support, default to `false`.\n- `--changed` / `-c` only test changed test files(test files means files that match `${pwd}/test/**/*.test.(js|ts)`)\n- `--dry-run` / `-d` whether dry-run the test command, just show the command \n- see more at https://mochajs.org/#usage\n\n#### environment\n\nEnvironment is also support, will use it if options not provide.\n\nYou can set `TESTS` env to set the tests directory, it support [glob] grammar.\n\n```bash\nTESTS=test/a.test.js egg-bin test\n```\n\nAnd the reporter can set by the `TEST_REPORTER` env, default is `spec`.\n\n```bash\nTEST_REPORTER=doc egg-bin test\n```\n\nThe test timeout can set by `TEST_TIMEOUT` env, default is `60000` ms.\n\n```bash\nTEST_TIMEOUT=2000 egg-bin test\n```\n\n### cov\n\nUsing [nyc] to run code coverage, it support all test params above.\n\nCoverage reporter will output text-summary, json and lcov.\n\n#### options\n\nYou can pass any mocha argv.\n\n- `-x` add dir ignore coverage, support multiple argv\n- `--prerequire` prerequire files for coverage instrument, you can use this options if load files slowly when call `mm.app` or `mm.cluster`\n- `--typescript` / `--ts` enable typescript support, default to `false`, if true, will auto add `.ts` extension and ignore `typings` and `d.ts`.\n- `--nyc` nyc instruments passthrough. you can use this to overwrite egg-bin's default nyc instruments and add additional ones.\n  > if you want to add addtional `nyc` reporters, you need to use this rather than add `reporter` key in `.nycrc` because:\n  > - when same key exists in `.nycrc` and cmd instruments, nyc prefers instrument.\n  > - egg-bin have some default instruments passed to nyc like `-r` and `--temp-directory`\n  > - `egg-bin cov --nyc=\"-r teamcity -r text\"`\n\n- also support all test params above.\n\n#### environment\n\nYou can set `COV_EXCLUDES` env to add dir ignore coverage.\n\n```bash\n$ COV_EXCLUDES=\"app/plugins/c*,app/autocreate/**\" egg-bin cov\n```\n\n### pkgfiles\n\nGenerate `pkg.files` automatically before npm publish, see [ypkgfiles] for detail\n\n```bash\n$ egg-bin pkgfiles\n```\n\n### autod\n\nGenerate `pkg.dependencies` and `pkg.devDependencies` automatically, see [autod] for detail\n\n```bash\n$ egg-bin autod\n```\n\n## Custom egg-bin for your team\n\nYou maybe need a custom egg-bin to implement more custom features if your team has develop a framework base on egg.\n\nNow you can implement a [Command](lib/command.js) sub class to do that.\nOr you can just override the exists command.\n\nSee more at [common-bin].\n\n### Example: Add [nsp] for security scan\n\n[nsp] has provide a useful security scan feature.\n\nThis example will show you how to add a new `NspCommand` to create a new `egg-bin` tool.\n\n- Full demo: [my-egg-bin](test/fixtures/my-egg-bin)\n\n#### [my-egg-bin](test/fixtures/my-egg-bin/index.js)\n\n```js\nconst EggBinCommand = require('egg-bin');\n\nclass MyEggBinCommand extends EggBinCommand {\n  constructor(rawArgv) {\n    super(rawArgv);\n    this.usage = 'Usage: egg-bin [command] [options]';\n\n    // load directory\n    this.load(path.join(__dirname, 'lib/cmd'));\n  }\n}\n\nmodule.exports = MyEggBinCommand;\n```\n\n#### [NspCommand](test/fixtures/my-egg-bin/lib/cmd/nsp.js)\n\n```js\nconst Command = require('egg-bin').Command;\n\nclass NspCommand extends Command {\n  * run({ cwd, argv }) {\n    console.log('run nsp check at %s with %j', cwd, argv);\n  }\n\n  description() {\n    return 'nsp check';\n  }\n}\n\nmodule.exports = NspCommand;\n```\n\n#### [my-egg-bin.js](test/fixtures/my-egg-bin/bin/my-egg-bin.js)\n\n```js\n#!/usr/bin/env node\n\n'use strict';\nconst Command = require('..');\nnew Command().start();\n```\n\n#### Run result\n\n```bash\n$ my-egg-bin nsp\n\nrun nsp check at /foo/bar with {}\n```\n\n## License\n\n[MIT](LICENSE)\n\n\n[mocha]: https://mochajs.org\n[co-mocha]: https://npmjs.com/co-mocha\n[glob]: https://github.com/isaacs/node-glob\n[istanbul]: https://github.com/gotwarlost/istanbul\n[nsp]: https://npmjs.com/nsp\n[iron-node]: https://github.com/s-a/iron-node\n[intelli-espower-loader]: https://github.com/power-assert-js/intelli-espower-loader\n[power-assert]: https://github.com/power-assert-js/power-assert\n[ypkgfiles]: https://github.com/popomore/ypkgfiles\n[common-bin]: https://github.com/node-modules/common-bin\n[autod]: https://github.com/node-modules/autod\n","engines":{"node":">= 6.0.0"},"gitHead":"05dca7f5f78392c3c5eabba1f076b9cbfcc8b540","scripts":{"ci":"npm run lint && npm run pkgfiles -- --check && npm run ci-test-only && npm run cov","cov":"nyc -r lcov -r text-summary npm run test-local","lint":"eslint .","test":"npm run lint -- --fix && npm run test-local","autod":"node bin/egg-bin.js autod","pkgfiles":"node bin/egg-bin.js pkgfiles","test-local":"node bin/egg-bin.js test -t 3600000","ci-test-only":"npm run test-local -- test/lib/cmd/cov.test.js"},"_npmUser":{"name":"mansonchor.zzw","email":"mansonchor1987@gmail.com"},"repository":{"url":"git+https://github.com/eggjs/egg-bin.git","type":"git"},"_npmVersion":"8.1.0","description":"egg developer tool","directories":{},"_nodeVersion":"16.12.0","dependencies":{"nyc":"^13.3.0","chalk":"^4.1.1","debug":"^4.3.1","mocha":"^6.0.2","globby":"^9.2.0","semver":"^7.3.5","ts-node":"^7","co-mocha":"^1.2.2","egg-utils":"^2.4.1","minimatch":"^3.0.4","ypkgfiles":"^1.6.0","common-bin":"^2.9.0","mz-modules":"^2.1.0","detect-port":"^1.3.0","power-assert":"^1.6.1","test-exclude":"^5.1.0","egg-ts-helper":"^1.25.9","espower-source":"^2.3.0","inspector-proxy":"^1.2.1","jest-changed-files":"^25.5.0","source-map-support":"^0.5.19","intelli-espower-loader":"^1.1.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"mm":"^3.2.0","mz":"^2.7.0","egg":"^2.29.4","autod":"^3.1.1","babel":"^6.3.26","jsdom":"^8.0.1","react":"^0.14.7","coffee":"^5.4.0","enzyme":"^2.0.0","eslint":"^4.12.1","egg-mock":"^4.1.0","cross-env":"^3.1.3","react-dom":"^0.14.7","typescript":"^3","@types/mocha":"^5.0.0","babel-register":"^6.4.3","esbuild-register":"^2.5.0","eslint-config-egg":"^7.3.1","babel-preset-airbnb":"^1.0.1","react-addons-test-utils":"^0.14.7"},"_npmOperationalInternal":{"tmp":"tmp/egg-bin_4.17.0-beta1_1642237574162_0.7973671991067173","host":"s3://npm-registry-packages"},"publish_time":1642237574314,"_cnpm_publish_time":1642237574314,"dist-tags":{"beta":"7.0.0-beta.0","latest":"6.13.0","latest-4":"4.20.0","latest-5":"5.19.0","release-5.x":"5.19.0"}}