Giter Site home page Giter Site logo

storage.io's Introduction

NPM version License Dependency status

storage.io

Example

import {
  session, // sessionStorage
  local    // localStorage
} from 'storage.io'

local.set('i', 123)
local.set('f', 12.3)
local.set('s', '123')
local.set('j', {
  name: 'test'
})

local.remove('i')

local.clear()
  • basic queue
import { Queue } from 'storage.io'

const queue = new Queue({
  name: 'local-queue',
  limit: 100,
  type: 'local'
})

queue.push(1)
queue.push('a')
queue.push({
  name: 'test'
})

queue.shift()
queue.pop()

queue.size()

queue.clear()
  • basic store
import { Store } from 'storage.io'

const store = new Store({
  name: 'local-store',
  type: 'local'
})

store.set('a', 1)
store.set('b', 's')
store.set('c', {
  name: 'test'
})

store.get('a')

store.remove('a')
store.entities()
store.keys()
store.all()

store.clear()
store.size()

APIs

  • storage: (session|local)

    • set(key, value)
    • set(key, value, expire)
    • get(key)
    • remove(key)
    • clear()
  • queue

    • push(value)
    • shift()
    • pop()
    • all()
    • size()
    • clear()
    • destroy()
  • store

    • set(key, value)
    • get(key)
    • all()
    • keys()
    • entities()
    • size()
    • remove(key)
    • clear()
    • destroy()

License

MIT

storage.io's People

Watchers

James Cloos avatar  avatar

Forkers

lnked

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.