JavaScript code bricks package helpers as a npm module

node, package, build, test, auto
npm install aureooms-node-package@7.0.0



JavaScript code bricks package helpers as a npm module.

NPM license NPM version Build Status Coverage Status Dependencies Status devDependencies Status Code Climate NPM downloads per month GitHub issues

Used in js-algo, js-data-structures and all their subpackages to handle building and testing.

Use together with sak to get automated package creation as well as duo, component, bower, and npm registration and releases.

Automated package creation and registration:

To run the following command you must:

  • install npm
  • install bower
  • install sak
  • log in for npm in the terminal

The following command will:

  1. Create a new directory named js-<namespace> in the current working directory;
  2. Initialize a new git repository in this directory;
  3. Create a repository named js-<namespace> on for <username>;
  4. Add an AGPL LICENSE file to the repository;
  5. Configure the local git repository with https://<username><username>/js-<namespace> as its origin remote;
  6. Create a gh-pages branch that will be populated by the npm run doc command using groc;
  7. Create a with badges;
  8. Create a configuration file for or;
  9. Create a pkg.json, a package.json, a bower.json and a component.json;
  10. Register a package named <username>-js-<namespace> on npm and bower.

After running the command you will have to:

  1. Register the repository on or;
  2. Register the repository on;
  3. Register the repository on

The sak $ command to run is:

$ codebricks new <namespace> <description> --keywords <keyword>* --username <username> --ci (travis-ci|

Or the shortened version of it:

$ cdb n <namespace> <description> -k <keyword>* -u <username> -c (travis-ci|

Note that --ci travis-ci is the default. --keywords can be left empty. If --username is not given then either sak can find it in your ~/.sak config file or will prompt for it.

Automated releases

Release a major version for duo, component, bower, and npm:

$ npm release major

Release a minor version for duo, component, bower, and npm:

$ npm release minor

Release a patch version for duo, component, bower, and npm:

$ npm release patch

Release version <semver> for duo, component, bower, and npm:

$ npm release <semver>

Note that $ npm release <...> can be shortened to $ npm r <...>.

How does the doc, build and test commands work?

Running the package creation command explained earlier will install aureooms-node-package as a development dependency of your package. This is equivalent to running:

npm install --save-dev aureooms-node-package

This will give your project access to tree runnables located in node_modules/.bin. The package creation command will add these scripts to your package.json:

"scripts": {
    "doc": "./node_modules/.bin/groc",
    "build": "./node_modules/.bin/aureooms-node-package-build",
    "test": "./node_modules/.bin/aureooms-node-package-test"

It will also create a pkg.json file, assuming your code tree is located in js/src and your testing index.js is located in test/js:

    "name": "{namespace}",
    "code": {
        "main": [ "js", "dist", "<namespace>.js" ],
        "test": [ "test", "js" ]
    "debug": false,
    "src": "js/src/",
    "out": "js/dist/"

Running npm run build will parse your code tree recursively and in lexicographical order, concatenating all the files it encounters in js/dist/<namespace>.js and minify this file to js/dist/<namespace>.min.js.

Running npm run doc will generate the documentation using groc and publish it on (gh-pages branch). Before running this command you must make sure to have committed all your local changes.

Running npm run test will test the main code file using the test code referenced by test/js/index.js.