pilcrowonpaper/oslo

A collection of auth-related utilities

TypeScript

1,147

26 commits

updated Jan 20, 2025

See the code

README

oslo

This package has been deprecated. Please use the packages published under the Oslo project instead.

A collection of auth-related utilities, including:

  • oslo/cookie: Cookie parsing and serialization
  • oslo/crypto: Generate hashes, signatures, and random values
  • oslo/encoding: Encode base64, base64url, base32, hex
  • oslo/jwt: Create and verify JWTs
  • oslo/oauth2: OAuth2 helpers
  • oslo/otp: HOTP, TOTP
  • oslo/password: Password hashing
  • oslo/request: CSRF protection
  • oslo/webauthn: Verify Web Authentication API attestations and assertions

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

pilcrowonpaper/oslo

A collection of auth-related utilities

TypeScript

1,147

26 commits

updated Jan 20, 2025

See the code

README

oslo

This package has been deprecated. Please use the packages published under the Oslo project instead.

A collection of auth-related utilities, including:

  • oslo/cookie: Cookie parsing and serialization
  • oslo/crypto: Generate hashes, signatures, and random values
  • oslo/encoding: Encode base64, base64url, base32, hex
  • oslo/jwt: Create and verify JWTs
  • oslo/oauth2: OAuth2 helpers
  • oslo/otp: HOTP, TOTP
  • oslo/password: Password hashing
  • oslo/request: CSRF protection
  • oslo/webauthn: Verify Web Authentication API attestations and assertions

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

Project health

npm

Latest release

1.2.1 · Jun 26, 2024

Releases this year

0
Deprecated

Significant stargazers

LongYinan

5,095 followers · starred Feb 2024

Eduardo San Martin Morote

6,580 followers · starred Apr 2024

Paolo Ricciuti

321 followers · starred Oct 2023

Nate Moore

1,964 followers · starred Oct 2023