simple-storage-tools
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.8 • Public • Published

    Coverage Status Build Status

    Simple Storage

    a lightweight library for projects that allow you to work with local and session storage.

    Installation

    npm install simple-storage-tools --save
    yarn add simple-storage-tools
    bower install simple-storage-tools --save

    Usage

    first, you must import it.

    Javascript

    var Storage = require('simple-storage-tools').Storage;

    TypeScript

    import { Storage } from 'simple-storage-tools';

    then you can use it like this:

    let json = {
        value1: 'Hello',
        value2: 'World'
    }
     
    // it will store `json` as an session storage
    Storage.set('some-storage', json); 
     
    // it will store `json` as an local storage
    Storage.set('some-storage', json, true);
     
    // it will get storage from sessionStorage Object
    let r = Storage.get('some-storage');
    // it will get storage from localStorage Object
    // let r = Storage.get('some-storage', true);
     
    console.log(r.value1 + ' ' + r.value2); // print Hello World in console

    you can see more examples here

    Test

    npm run test

    Contribute

    feel free to fork and do what ever you want (or send pull requests).

    for contribute this project, first clone the project and go to project folder:

    git clone https://github.com/MetaiR/simple-storage-tools.git
    cd simple-storage-tools

    then run:

    npm install

    after that you ready to go :D

    Install

    npm i simple-storage-tools

    DownloadsWeekly Downloads

    2

    Version

    1.0.8

    License

    SEE LICENSE IN LICENSE

    Unpacked Size

    82.9 kB

    Total Files

    19

    Last publish

    Collaborators

    • avatar