Skip to content

json-storage-fs is a very lightweight package with no dependencies that was designed for small Node.js applications

License

Notifications You must be signed in to change notification settings

lapkoshka/json-storage-fs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

json-storage-fs - Simple key-value storage based on JSON for Node.js

npm package

Installation

$ npm install json-storage-fs

Simple to use

json-storage-fs is a very lightweight package with no dependencies that was designed for small Node.js applications

Example:

const { JsonStorage, config } = require('json-storage-fs');

// (optional set catalog path)
config({ catalog: '/tmp/meow'});

JsonStorage.set('name', 'Alice');
const name = JsonStorage.get('name');
console.log(name); // -> 'Alice'

API

Get value from key

static get(key: string): any|undefined

Set value

static set(key: string, data: any): void

Delete value by key

static delete(key: string): void

Get all high-level keys

static getAllKeys(): string[]

Clear storage

static clearAll(): void

About

json-storage-fs is a very lightweight package with no dependencies that was designed for small Node.js applications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published