npm.io
5.0.0 • Published 3d ago

skweb-express-jwt

Licence
MIT
Version
5.0.0
Deps
3
Size
22 kB
Vulns
0
Weekly
0

skweb-express-jwt

JWT utilities for Express applications.

Installation

npm install skweb-express-jwt

Usage

const JWT = require('skweb-express-jwt')

const jwt = new JWT({
  secret: 'your-secret-key',
  algorithms: ['HS256']
})

// Sign a token
const token = jwt.sign({ userId: 123 })

// Verify a token
const decoded = jwt.verify(token)

// Use as middleware
app.use(jwt.midware)

License

MIT

Keywords