0.0.3 • Published 5 years ago

token-moderatoro v0.0.3

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

#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);
    })
0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago