Unstorage

An async Key-Value storage API with conventional features like multi driver...

README

💾 Unstorage


Unstorage provides an async Key-Value storage API with conventional features like multi driver mounting, watching and working with metadata, dozens of built-in drivers and a tiny core.


Features


- Designed for all environments: Browser, NodeJS, and Workers
- Lots of Built-in drivers
- Asynchronous API
- Unix-style driver mounting to combine storages
- Default in-memory storage
- Tree-shakable utils and tiny core
- Auto JSON value serialization and deserialization
- Binary and raw value support
- State snapshots and hydration
- Storage watcher
- HTTP Storage with built-in server

Usage


Install unstorage npm package:

  1. ```sh
  2. # yarn
  3. yarn add unstorage

  4. # npm
  5. npm install unstorage

  6. # pnpm
  7. pnpm add unstorage
  8. ```

  1. ```js
  2. import { createStorage } from "unstorage";

  3. const storage = createStorage(/* opts */);

  4. await storage.getItem("foo:bar"); // or storage.getItem('/foo/bar')
  5. ```

👉 Check out the the documentation for usage information.

Contribution


- Clone repository
- Install dependencies with pnpm install
- Use pnpm dev to start jest watcher verifying changes
- Use pnpm test before pushing to ensure all tests and lint checks passing

License




[npm-version-src]: https://img.shields.io/npm/v/unstorage?style=flat&colorA=18181B&colorB=F0DB4F
[npm-version-href]: https://npmjs.com/package/unstorage
[npm-downloads-src]: https://img.shields.io/npm/dm/unstorage?style=flat&colorA=18181B&colorB=F0DB4F
[npm-downloads-href]: https://npmjs.com/package/unstorage
[github-actions-src]: https://img.shields.io/github/workflow/status/unjs/unstorage/ci/main?style=flat&colorA=18181B&colorB=F0DB4F
[github-actions-href]: https://github.com/unjs/unstorage/actions?query=workflow%3Aci
[codecov-src]: https://img.shields.io/codecov/c/gh/unjs/unstorage/main?style=flat&colorA=18181B&colorB=F0DB4F
[codecov-href]: https://codecov.io/gh/unjs/unstorage
[bundle-src]: https://img.shields.io/bundlephobia/minzip/unstorage?style=flat&colorA=18181B&colorB=F0DB4F
[bundle-href]: https://bundlephobia.com/result?p=unstorage
[license-src]: https://img.shields.io/github/license/unjs/unstorage.svg?style=flat&colorA=18181B&colorB=F0DB4F
[license-href]: https://github.com/unjs/unstorage/blob/main/LICENSE