![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
egg developer tool, extends common-bin.
$ npm i egg-bin --save-dev
Add egg-bin
to package.json
scripts:
{
"scripts": {
"dev": "egg-bin dev",
"debug": "egg-bin debug",
"test-local": "egg-bin test",
"test": "npm run lint -- --fix && npm run test-local",
"cov": "egg-bin cov",
"lint": "eslint .",
"ci": "npm run lint && npm run cov"
}
}
All the commands support these specific v8 options:
--debug
--inspect
--harmony*
--es_staging
$ egg-bin [command] --debug --es_staging
Start dev cluster on local
env, it will start a master, an agent and a worker.
$ egg-bin dev
--framework
egg web framework root path.--baseDir
application's root path, default to process.cwd()
.--port
server port, default to 7001
.--cluster
worker process number, skip this argvs will start only 1
worker, provide this without value will start cpu
count worker.--sticky
start a sticky cluster server, default to false
.Debug egg app with V8 Inspector Integration.
$ egg-bin debug
Using mocha with co-mocha to run test.
power-assert is the default assert
library, and intelli-espower-loader will be auto required.
$ egg-bin test [files] [options]
files
is optional, default to test/**/*.test.js
test/fixtures
, test/node_modules
is always exclude.test/.setup.js
If test/.setup.js
file exists, it will be auto require as the first test file.
test
├── .setup.js
└── foo.test.js
You can pass any mocha argv.
--require
require the given module--grep
only run tests matching --timeout
milliseconds, default to 30000Environment is also support, will use it if options not provide.
You can set TESTS
env to set the tests directory, it support glob grammar.
TESTS=test/a.test.js egg-bin test
And the reporter can set by the TEST_REPORTER
env, default is spec
.
TEST_REPORTER=doc egg-bin test
The test timeout can set by TEST_TIMEOUT
env, default is 30000
ms.
TEST_TIMEOUT=2000 egg-bin test
Using istanbul to run code coverage, it support all test params above.
Coverage reporter will output text-summary, json and lcov.
NOTE: cov
is replaced with test
at win32 system.
You can pass any mocha argv.
-x
add dir ignore coverage, support multiple argvYou can set COV_EXCLUDES
env to add dir ignore coverage.
$ COV_EXCLUDES="app/plugins/c*,app/autocreate/**" egg-bin cov
Generate pkg.files
automatically before npm publish, see ypkgfiles for detail
$ egg-bin pkgfiles
You maybe need a custom egg-bin to implement more custom features if your team has develop a framework base on egg.
Now you can implement a Command sub class to do that. Or you can just override the exists command.
See more at common-bin.
nsp has provide a useful security scan feature.
This example will show you how to add a new NspCommand
to create a new egg-bin
tool.
const EggBinCommand = require('egg-bin');
class MyEggBinCommand extends EggBinCommand {
constructor(rawArgv) {
super(rawArgv);
this.usage = 'Usage: egg-bin [command] [options]';
// load directory
this.load(path.join(__dirname, 'lib/cmd'));
}
}
module.exports = MyEggBinCommand;
const Command = require('egg-bin').Command;
class NspCommand extends Command {
* run({ cwd, argv }) {
console.log('run nsp check at %s with %j', cwd, argv);
}
description() {
return 'nsp check';
}
}
module.exports = NspCommand;
#!/usr/bin/env node
'use strict';
const Command = require('..');
new Command().start();
$ my-egg-bin nsp
run nsp check at /foo/bar with {}
FAQs
egg developer tool
The npm package egg-bin receives a total of 17,452 weekly downloads. As such, egg-bin popularity was classified as popular.
We found that egg-bin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 14 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.