Package containing useful helper functions.
This is a Node.js module available through the npm registry.
Installation is done using the
npm install
command:
$ npm install @jrssnjn/utils
Reads data from a file and transforms dynamic values from the said file.
import { interpolate } from '@jrssnjn/utils/interpolate';
import path from 'node:path';
// <p>Welcome {title} {name}!</p>
// template file path
const path = path.join('location-of-file', 'welcome.email');
// dynamic values to update
const fieldsToUpdate = { title: 'Mr.', name: 'John Doe' };
const updatedData: string = interpolate(path, fieldsToUpdate);
console.log(updatedData); // // <p>Welcome Mr. John Doe!</p>
- Make a branch for your feature / bug-fix
- Commit your changes
- Add unit tests for your change if applicable & execute existing tests
- Pull Remote branch and rebase
- Push branch to remote
- Submit a pull request
To run the test suite, first install the dependencies, then run npm test
:
$ npm install
$ npm test
The author of @jrssnjn/utils
is Jairus San Juan