JWT implementation for Node.js

I have written a JavaScript library to sign and verify JSON Web Tokens. It has no dependencies and at the moment works only with HMAC SHA algorithms.

import jwt from '@onelastjedi/node-jwt'

const secret = process.env.__SECRET__

const data = {
  exp: 60 * 60 * 24 * 7, // 7 days
  user: { id: 1, name: 'Mary' }
}

jwt.sign(data, secret) // eyJhbGc.....
jwt.verify(token, secret)
/*
  {
    alg: 'HS256',
    typ: 'JWT',
    user: { id: 1, name: 'Mary' },
    iat: ...,
    exp: ...,
    }
*/

Sources on Sourcehut and GitHub.