authful
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Authful

MIT License npm version dependencies

A lightweight authentication library for Node

Summary

I find myself continously going through the process of implementing authentication for my projects and they only require a basic system to get started. This is a slightly higher level library that wraps jsonwebtoken and bcrypt and provides common methods.

1.3kB minified + gzip

Installation

npm install authful -s
import * as Authful from 'authful'
 
const authful = new Authful({
  secret: 'ffj3493$R#J@$f#$Jo3ofk',
  expiresIn: '1h' // default: 24hr
})

Usage

docs in progress

#️⃣ Hash a password

const hash = await authful.pwd.hash({ plaintext })

:check: Check a password

const match = await authful.pwd.check({ hash, plaintext })

🔒 Create a token

const token = await authful.token.create(payload)

🔐 Decode a token

const payload = await authful.token.decode(token)

🔄 Refresh a token

const token2 = await authful.token.refresh(token)

Readme

Keywords

none

Package Sidebar

Install

npm i authful

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

22.9 kB

Total Files

9

Last publish

Collaborators

  • o8e