cryptonyx
v0.0.2
Published
π Unified API for cryptographic operations in web and runtime environments, supporting Node.js, browsers, and other platforms
Downloads
5
Readme
π‘οΈ cryptonyx
π Unified API for cryptographic operations in web and runtime environments, supporting Node.js, browsers, and other platforms
This library provides a single api to use web-crypto and Subtle Crypto in both Node.js using Crypto Module and Web targets using Web Crypto API using Conditional Exports.
Requirements:
- Node.js: Version 15 and above (this library provides no polyfills for older versions!) π¦π
- Browser: Secure Context (HTTPS/Localhost) in Supported Browsers ππ
- Other Runtimes: Exposed
globalThis.crypto
andglobalThis.crypto.subtle
. (you can polyfill if needed) βοΈπ
π Usage
Install:
# nyxi
nyxi cryptonyx
# pnpm
pnpm install cryptonyx
# npm
npm install cryptonyx
# yarn
yarn add cryptonyx
Import:
// ESM
import { getRandomValues, randomUUID, subtle } from 'cryptonyx'
// CommonJS
const { subtle, randomUUID, getRandomValues } = require('cryptonyx')
π± Development
- π Clone this repository
- π₯ Install latest LTS version of Node.js
- π§ Enable Corepack using
corepack enable
- π¦ Install dependencies using nyxi π§ Always right package manager
- π Run
nyxr dev
π License
MIT - Made with π