New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@immutabl3/mini-forage

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@immutabl3/mini-forage

a small, indexdb key-value store with a localStorage API

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

mini-forage

mini-forage is a fast and simple storage library for indexeddb with an asyncronous localStorage-esque API

Install

npm install @immutabl3/mini-forage

How to use

Async

Because miniforage uses async storage, all methods return an promise. It's otherwise exactly the same as the localStorage API.

import miniforage from '@immutabl3/mini-forage';

await miniforage.setItem('key', 'value');

const result = await miniforage.getItem('key');
// result === 'value'

Storing Blobs, TypedArrays, and other JS objects

You can store JSON, ArrayBuffers, Blobs and TypedArrays in miniforage. miniforage automatically JSON.parse() and JSON.stringify() values when getting/setting

Multiple instances

You can create multiple instances of miniforage that point to different stores

import { MiniForage } from '@immutabl3/mini-forage';
const store = MiniForage({
  name: "nameHere"
});

const otherStore = MiniForage({
  name: "otherName"
});

// Setting the key on one of these doesn't affect the other.
store.setItem('key', 'value');
otherStore.setItem('key', 'value2');

Library Size

As of version 1.0.0 the payload added to your app is rather small. Served using gzip compression, miniforage will add less than 1.5k to your total bundle size:

minified
`~3.9kB`
gzipped
`~1.3kB`
brotli'd
`~1.1kB`

License

MITå

FAQs

Package last updated on 01 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts