Opinionated ESNext application scripts and configurations.
npm install esnext-scripts
yarn add esnext-scripts
- Latest EMACScript supports backed by:
How many times you had been confused by the obsolete
babelsettings (plugins, presets) or even worse, your applications got broken?
esnext lint [optional-folder]- start linting with
esnext exec <script>- execute a Node.js script with ESNext supports.
esnext start [script]- server process manager for both development (nodemon) and production (pm2) with dotenv supports.
startyour application server (via the given script file) for:
NODE_ENV=development- with builtin nodemon, monitoring any changes in your application with hotreload supports.
NODE_ENV=production- backed by pm2 with
clustermode, scale accross all CPUs available.
- NOTE By default,
esnext start [script]will read
--env <custom-dotenv-path>is also supported.
esnext stop [name]- synonym to
pm2 stop [name](
esnext kill- synonym to
esnext list- synonym to
esnext test- start executing your
Jesttest specs. Supported options:
--detectLeaks- EXPERIMENTAL: Detect memory leaks in tests. After executing a test, it will try to garbage collect the global object used, and fail if it was leaked.
--detectOpenHandles- Print out remaining open handles preventing Jest from exiting at the end of a test run.
--forceExit- Force Jest to exit after all tests have completed running. This is useful when resources set up by test code cannot be.
--watch- Watch files for changes and rerun tests related to changed files.
--verbose- Display individual test results with the test suite hierarchy.
A sample structure of React application folder.
- __tests__/ App.spec.jsx - src/ App.jsx
- Configure your
NOTE All these settings will be stringified from JSON to
string then passed to
jest does not support any programmatic way for calling at the moment.
MIT License 2018 © Jim Zhan