0.0.2 • Published 12 months ago
cryptonyx v0.0.2
🛡️ 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 💞