Skip to content

arextar/Stay-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Stay-js

A very simple JavaScript library for using persistent storage in the browser and node-js.

API

  • void stay.set(String key, String value) — Sets a key to the given value
  • String stay.get(String key) — Gets the value set to a key
  • Boolean stay.exists(String key) — Returns true if key exists in the storage, false otherwise
  • void stay.del(String key) — Removes the given key from the storage

Example usage

Browser

stay.set("name", "Foo");
stay.get("name"); //=== "Foo"
stay.exists("name"); //=== true
stay.del("name");
stay.get("name"); //=== null
stay.exists("name"); //=== false

##node

var stay = require("./node-stay").store("stay.txt");
stay.set("name", "Foo");
stay.get("name"); //=== "Foo"
stay.exists("name"); //=== true
stay.del("name");
stay.get("name"); //=== null
stay.exists("name"); //=== false

About

Very simple persistent storage library.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published