token-moderatoro

0.0.3 • Public • Published

#TOKEN

Generate a token related to user id, saving it to .js file you want, then search it

##Installing

npm install --save token-moderatoro@latest

##How-to ###Create token and send it to file

const token = require('token-moderatoro');

const idToRelate = '1';
const ttlInSeconds = '60'; // 0 if not defined what will make token last forever
const filePath = __dirname + '/../../../resources/collections/';

token.createTokenAndSendToFile(idToRelate, ttlInSeconds, filePath)
    .then(resToken => {
        console.log(resToken);
    })
    .catch(error => {
        console.log(error);
    })

###Search for token

const token = require('token-moderatoro');

const tokenValue = '58abdc7857dc36fa4211992955bd6348';
const filePath = __dirname + '/../../../resources/collections/';

token
    .readToken(tokenValue, filePath)
    .then(res => {
        console.log(res);
    })
    .catch(rej => {
        console.log(rej);
    })

Readme

Keywords

Package Sidebar

Install

npm i token-moderatoro

Weekly Downloads

0

Version

0.0.3

License

ISC

Unpacked Size

5.21 kB

Total Files

6

Last publish

Collaborators

  • giryco