UNPKG

@fusedb/crypto

Version:
77 lines (51 loc) โ€ข 1.92 kB
# ๐Ÿงฉ FUSE Middleware: Crypto > A [FUSE](https://github.com/Fast-Unified-Storage-Engine/FUSE) middleware that provides AES encryption to your data ![npm i @fushdb/json](https://img.shields.io/badge/npm%20i-@fushdb/crypto-black) ![npm](https://img.shields.io/npm/v/@fusedb/crypto) [![license](https://img.shields.io/npm/l/@fusedb/crypto)](./LICENSE) ![FUSE โšก](https://img.shields.io/badge/FUSE-โšก-yellow) --- ## ๐Ÿ“ฆ Installation ```bash npm install @fusedb/core npm install @fusedb/crypto ``` --- ## ๐Ÿš€ Usage ```js const FUSE = require("@fusedb/core"); const JSONDriver = require("@fusedb/json"); const Crypto = require("@fusedb/crypto"); const db = new FUSE({ driver: new JSONDriver({ path: "./data.json" }), middleware: [ new Crypto({ key: process.env.DB_KEY || "12345678901234567890123456789012", }) ] }); ``` --- ## โš™๏ธ Options | Option | Type | Description | | ------ | ----- | --------------------------------------------- | | `key` | `string` | *A 32 character long string for the encryption key* | --- ## โœ… Features * โœ… Works with any FUSE driver * โœ… Compatible with `.get()`, `.set()`, `.bulkSet()`, etc. * โœ… AES-256-GCM encryption --- ## ๐Ÿ“š Related * [FUSE Core](https://www.npmjs.com/package/@fusedb/core) * [FUSE Github](https://github.com/Fast-Unified-Storage-Engine/FUSE) * [Middleware API Specification](https://github.com/Fast-Unified-Storage-Engine/FUSE/blob/main/MIDDLEWARE_SPECIFICATION.md) --- ## ๐Ÿค Contributing Want to make your own middleware? * Name it like: `fusedb-<name>` or `@your-org/fusedb-<name>` * Follow the [Middleware Guidelines](https://github.com/fusedb/.github/blob/main/CONTRIBUTING.md) Feel free to share your plugin with the community! --- ## ๐Ÿงพ License Licensed under the [Apache-2.0](./LICENSE).