@sraleik/mock-bluzelle
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Mock Bluzelle

Description

Simple mock of bluzelle

create the bluzelle interface for a key value storage (like nodeStorage)

Installation

npm install @sraleik/mock-bluzelle
yarn add @sraleik/mock-bluzelle
pnpm add @sraleik/mock-bluzelle

Simple Usage

This will create a bluzelle like bdd using node-storage to persist data

const { createMockBluzelle } = require('@sraleik/mock-bluzelle');
const mockBluzelle = await createMockBluzelle() 

await mockBluzelle.create('foo', 'bar')
simpleData = await mockBluzelle.read('foo')

console.log('simpleData',simpleData)

Advance Usage

This will create a bluzelle like bdd using your browser localStorage to persist data

const { bluzellifier } = require('@sraleik/mock-bluzelle');
const bluzelleLikeBdd = bluzellifier(window.localStorage)
const mockBluzelle = bluzelleLikeBdd({public: 'fake', private: 'morefake'})

await mockBluzelle.create('foo', 'bar')
simpleData = await mockBluzelle.read('foo')

console.log('simpleData',simpleData)

Readme

Keywords

Package Sidebar

Install

npm i @sraleik/mock-bluzelle

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

5.09 kB

Total Files

8

Last publish

Collaborators

  • sraleik