GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - aheinze/JSONStorage: simple storage helper inspired by the redis api

BranchesTags
Open more actions menu

Latest commit

 

History

23 Commits
23 Commits

Folders and files

NameName
Last commit message
Last commit date
tests
tests
 
 
README.md
README.md
 
 
bower.json
bower.json
 
 
storage.js
storage.js
 
 

Repository files navigation

JSONStorage

A simple storage helper inspired by the redis api.

Usage

var db = JSONStorage.select("mydb");

db.set("mykey", 1);

db.incr("mykey");

db.get("mykey"); // 2

// Lists

db.rpush("mylist", "item1");
db.rpush("mylist", "item2");
db.lpush("mylist", "item3");

db.get("mylist");  // ["item3", "item1", "item2"]

// hashes

db.hset("myhash", "myfield", 1);
db.hmset("myhash", "myfield-1", "value-1", "myfield-2", "value-2");

db.hkeys("myhash"); // ["myfield", "myfield-1", "myfield-2"]
db.hvals("myhash"); // [1, "value-1", "value-2"]

db.hget("myhash", "myfield"); // 1

db.get("myhash"); // {"myfield":1, "myfield-1":"value-1", "myfield-2":"value-2"}

implemented methods

set, setex, get, exists, del, type, append, incr, decr, 
llen, lpush, rpush, lset, lindex,
hset, hget, hgetall, hexists, hkeys, hvals, hlen, hincrby, hmset, hmget

Adaptars

  • memory (default)
  • local - using window.localStorage
  • session - using window.sessionStorage
var memory  = JSONStorage.select("mydb"),
    local   = JSONStorage.select("mydb", "local"),
    session = JSONStorage.select("mydb", "session");

About

simple storage helper inspired by the redis api

Resources

Readme
Activity

Stars

19 stars

Watchers

4 watching

Forks

5 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.