1.0.1 • Published 5 years ago

nodejs-pkj-template v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

nodejs-pkj-template

This is the template for starting a Node.js package

Quick Start

Create the app:

mkdir /tmp/foo && cd $_;
npm init -y;

Since the package is ESM, install ESM:

npm i -S esm;

Install nodejs-pkj-template:

npm i -S nodejs-pkj-template;

Create main module:

vi /tmp/foo/app.js;
/* /tmp/foo/app.js */
import {add, sub, div, mul} from 'nodejs-pkj-template';
console.log(`add(1,2)=${add(1,2)}`);
console.log(`sub(1,2)=${sub(1,2)}`);
console.log(`div(1,2)=${div(1,2)}`);
console.log(`mul(1,2)=${mul(1,2)}`);

Run the main module:

cd /tmp/foo/;
node -r esm app;

Unit test the package

Test nodejs-pkj-template:

cd ./node_modules/nodejs-pkj-template/;
npx jest --coverage;
#npm run test;

License

MIT

Author

  • Github: sasadango mail to: caution.sk@gmail.com