@studyportals/data-storage
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

DataStorage

Create a browser independent local storage solution.

Installation:

This package is written in ES5 and is available on NPM.

npm install --save @studyportals/data-storage

Functions:

Javascript

import {DataStorage} from "@studyportals/data-storage";

/**
 * Store any type of value with an TTL of 1800 seconds.
 */
DataStorage.store('AnyObject', {
    prop1: 'test-1',
    prop2: 'test-2'
}, 1800);

/**
 * Retrieve from the storage.
 */
DataStorage.retrieve('AnyObject');

/**
 * Remove an object from the storage.
 */
DataStorage.remove('AnyObject');

/**
 * Add properties to an existing object with an TTL of 1800 seconds.
 */
DataStorage.update('AnyObject', {
    prop3: 'test-3'
}, 1800);

Readme

Keywords

none

Package Sidebar

Install

npm i @studyportals/data-storage

Weekly Downloads

290

Version

2.0.0

License

BSD-3-Clause

Unpacked Size

11.5 kB

Total Files

7

Last publish

Collaborators

  • jordi-studyportals
  • fationsh
  • orlandoliccardo
  • ozanborafikir
  • prestonvantonder
  • mrmaruf-studyportal
  • alparslanylmaz
  • georgianaschipor
  • tamassoos
  • dandobrescu
  • gilalves95
  • martinestudyportals
  • simaopcsantos
  • skrothapalli1
  • armandduijnstudyportals
  • borismo
  • alexandramarginean
  • jooshuys
  • studyportals-devops
  • jens-sp
  • stormyy
  • stefanklokgieters
  • royvaneijndhovensp