3.0.0 • Published 7 months ago

@varasto/multi-storage v3.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

@varasto/multi-storage

npm

Storage implementation which retrieves and stores data to multiple other storage instances.

Installation

$ npm install --save @varasto/multi-storage

Usage

The package provides an function called createMultiStorage which takes multiple other storage instances as arguments. Data is retrieved from and stored to storages given as arguments.

import { createMemoryStorage } from '@varasto/memory-storage';
import { createMultiStorage } from '@varasto/multi-storage';

const storage1 = createMemoryStorage();
const storage2 = createMemoryStorage();

const multiStorage = createMultiStorage(storage1, storage2);

// This will insert the entry to both `storage1` and `storage2`.
await multiStorage.set('foo', 'bar', { value: 5 });
3.0.0

7 months ago

2.0.0

7 months ago

1.0.1

3 years ago

1.0.0

3 years ago