Socket
Socket
Sign inDemoInstall

mumba-jwt

Package Overview
Dependencies
15
Maintainers
6
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mumba-jwt

A service for working with JSON Web Tokens.


Version published
Maintainers
6
Install size
306 kB
Created

Readme

Source

Mumba JWT

A service for working with JSON Web Tokens based on jsonwebtoken.

Installation

$ npm install --save mumba-jwt

Examples

import {TokenService} from 'mumba-jwt';

// Sync example
let service = new TokenService({
  passKey: 'abc123'
});

let data = {
	foo: 'bar'
};

// Not a token.
service.decode('foo'); // null

// Creating and decoding token.
let token = service.sign(data, { subject: '123' });
let decoded = service.decode(token);

console.log(decoded.sub); // 123
console.log(decoded.foo); // bar

// Verifying a bad token.
service.verify('not.even.close')
  .catch(function (err: Error) {
	console.log(err);
  });

service.verify(token)
  .then(function (decoded: any) {
  	console.log(decoded.foo); // bar
  });

Tests

To run the test suite, first install the dependencies, then run npm test:

$ npm install
$ npm test

People

The original author of Mumba WAMP is Andrew Eddie.

List of all contributors

License

Apache 2.0


© 2017 Mumba Pty Ltd. All rights reserved.

Keywords

FAQs

Last updated on 19 Jun 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc