0.0.8 • Published 4 years ago

storage-dao v0.0.8

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

storage-DAO

a data access object that wraps the storage api

download

npm i storage-dao

or

yarn add storage-dao

import

module:

import WebStorage from 'storage-dao';

browser:

<script src="../dist/webStorage.js"></script>

Usage

const LS = new WebStorage({
        preId: 'Grewer__',
    });

export default LS

config

attributemustdefaultdesc
preIdyes-pre key id
timeSignno'-'The interval between the timestamp and the true value in value
typeno'localStorage'localStorage or sessionStorage
encryptnobtoaEncryption method
decryptnoatobDecryption method
timeGapno12 hourValue expiration time

methods typing

interface IResult {
  status: number
  key: string
  value: string | null
}
{
  set: (key: string, value: string, time?: string | number) => IResult
  get: (key: string) => IResult
  remove: (key: string) => { status: number, value: null | string }
}

Change Log

  • 1.0.0 : official release
  • version < 1.0.0 : developing
0.0.8

4 years ago

1.0.1

4 years ago

0.0.7

4 years ago

0.0.6

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago