pilcrowOnPaper / oslo

A collection of auth-related utilities
https://oslo.js.org
MIT License
946 stars 30 forks source link

oslo

A collection of auth-related utilities, including:

Aside from oslo/password, every module works in any environment, including Node.js, Cloudflare Workers, Deno, and Bun.

Documentation: https://oslo.js.org

Installation

npm i oslo
pnpm add oslo
yarn add oslo

Node.js

For Node.js 16 & 18, you need to polyfill the Web Crypto API. This is not required in Node.js 20.

import { webcrypto } from "node:crypto";

globalThis.crypto = webcrypto;

Alternatively, add the --experimental-global-webcrypto flag when running Node.

node --experimental-global-webcrypto index.js