Giter Club home page Giter Club logo

dache's Introduction

Dache

Use memory,session storagy or local storage to cache things.

Install

# NPM
npm install @awey/dache --save

# Yarn
yarn add @awey/dache

Useage

import Dache from '@awey/dache'

const dache = new Dache('local', 'myDache')
dache.set('username', 'Tom')

console.log(dache.get('username'))

API

  • new Dache(type: 'memory' | 'session' | 'local', name: string) => Dache: init a Dache instance
  • dache.get(key: string) => any: retrieve a value by key from cache
  • dache.set(key: string, value: any) => void: store a value by key to cache
  • dache.remove(key: string) => void: delete a value by key from cache
  • dache.clear() => void: clear all values in cache
  • dache.has(key: string): determines whether a key exists(not null)
  • dache.is(key: string, value: any): determines whether a value is equal(===) to the specified value

dache's People

Contributors

bboyawey avatar

Stargazers

Rihards Mantejs avatar

Watchers

 avatar

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.