3.0.0 • Published 7 months ago

@varasto/memory-storage v3.0.0

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

@varasto/memory-storage

npm

Implementation of an storage which stores values in memory instead of hard disk or remote server.

Because it provides full storage implementation without persistence, it's useful for writing test cases for libraries/applications that use Varasto storages for storing data.

Installation

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

Usage

The package provides a class called MemoryStorage which is an implementation of Storage type.

Basic usage of the API looks like this:

import { MemoryStorage } from '@varasto/memory-storage';

const storage = new MemoryStorage();

Memory storage instance also has an additional clear() method that will remove either all data from the storage, or items from specified namespace.

storage.clear(); // Removes all data from the storage.

storage.clear('foo'); // Removes all items from namespace "foo".
3.0.0

7 months ago

2.0.0

7 months ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago