npm.io
0.1.0 • Published 5 years ago

infofabric-node-common

Licence
ISC
Version
0.1.0
Deps
2
Size
4 kB
Vulns
3
Weekly
0

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.

Keywords