0.1.0 • Published 3 years ago

infofabric-node-common v0.1.0

Weekly downloads
6
License
ISC
Repository
github
Last release
3 years ago

infofabric-node-common

A small library that gives the following common functionalities

  • jwtUtils

Installation

npm install @infofabric/node-common

Usage

  • jwtUtils :

    const { jwtUtil } = require('@infofabric/node-common');
    
    // sample payload
    let payload = {
                userId : 'your-user-id', 
                buId : 'your-bu-id',
                roles : 'your-roles'
                }
    // let accessToken = jwtUtil.createJwtWithUser('your-user-id','your-bu-id');
    let accessToken = jwtUtil.createJwt(payload);

    Output should be your access-token


Tests

npm test

Contributing

In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.