@asaje/token-generator
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

Token generator

Simple web token generator

Usage

Installation

npm install @asaje/token-generator

or

yarn add @asaje/token-generator

How it works

import { sign, verify } from '@asaje/token-generator';

const key = 'my-super-key';
const token = sign({ data: 'Hello world', key }); // Generate token

console.log('token', token);

try {
  const info = verify({ key, token }); // Verify token
  console.log('token-info', info);
} catch (error) {
  console.log(error);
}

Readme

Keywords

none

Package Sidebar

Install

npm i @asaje/token-generator

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

3.62 kB

Total Files

7

Last publish

Collaborators

  • asaje379