- Fork this repository to your own GitHub account and then clone it to your local environment
- Install the dependencies with
npm install
- Write your changes into
lib/
- Add your tests into
test/
- Run
npm test
and make sure you have100%
of coverage
Testing into your Mono project:
- Run
npm link
to link the local repo to NPM. - Then run
npm link y
inside any Mono app - Follow the README to see how to use this module
A Mono module can have multiple files inside lib/
:
index.js
Should export a method (can be async
) and receives as argument: { log, conf, server, app }
init.js
File loaded when Mono init all files, same parameter as Mono init files. Should export a method (can be async
) and receives as argument: { log, conf, server, app }
routes.js
Same as Mono files so a module can add custom routes, see example
acl.js
File loaded to define Imperium roles/actions (same as Mono project files)
Files where are written AVA tests, it uses mono-test-utils to make API tests easy.
Feel free to check mono-mongodb tests how tests can be made.
This is where you can add files that won't be run by AVA, it's usully small Mono projects where you can test your module.
You can easily start your Mono project inside fixtures/
by running:
NODE_ENV=test npx mono dev test/fixtures/ok/
Where test/fixtures/ok/
is a simple Mono project using the module.