This module only works with Node v6+ and npm v3+ (or yarn), which are the current LTS versions. Please make sure you are running the right versions via
node -v && npm -vand update if needed.
# Install the modulenpm install --save-dev abc-environment# Run the setupnode_modules/.bin/abc setup# Now you can commit...git add ...git commit ...# ...and run commands directlynode_modules/.bin/abc testnpm test# Tip: Create an alias for "abc" to have an even shorter commandecho "alias abc='node_modules/.bin/abc'" >> ~/.bashrc && source ~/.bashrcabc test
Creates the directories and files for the whole project to run. This will modify files, so only run it on empty or version-controlled projects.
⚠️ When updating this module to the next higher minor version number, it is recommended to run the
setup command again to get the newest files! When updating to the next major number, running
setup is required.
The created directories and files are:
src/- Directory for your source code
src/index.js- Demo module file (if
tests/- Directory for your tests
tests/index.spec.js- Demo test file (if
.babelrc- Manages the Babel configuration throughout the whole project 1
.gitignore- Makes sure that you don't commit dependency files into version control
.npmignore- Makes sure that you only release the built files into npm
.travis.yml- Handles continuous integration with Travis
package.json- Adds three npm scripts:
Compiles the source files from
src/ into a
Runs the test files in the
tests/ directory. Using unit tests, you can check if your module always works in the way you expect it to. You can also see which parts of your code are covered by your tests by opening the generated
coverage/lcov-report/index.html in your browser.
Checks if your code is consistent and follows best practices (and optionally fix issues). By using a linter you can ensure that all your code looks the same, even if it was written by different developers. Linting also helps to catch common errors. This module uses the standard style guide.
Runs a specified file. Because we are using compiled code, it can get tedious if you have to run
build before you can run your code. Using the
run command, you can just specify the file and get it compiled and executed in one single step. This is used for development purposes, in production you should always use the compiled files generated using the