Nothing's plumb meaningless

    local-storage-parser

    1.1.0 • Public • Published

    npm Bower Travis npm npm

    Local Storage Parser

    Utility to work with localStorage Data as with Object

    Install

    npm install local-storage-parser
    

    API

    Init

     // import utility
    import LocalStorageParser from 'local-storage-parser';
     
    // create data namespace 
    const lsp = new LocalStorageParser('MyName');

    Methods

    set

    .set(obj: Object): undefined

    saves Object as String to Local Storage

    lsp.set({
        timestamp: Date.now(),
        active: true
    }); // saves {MyName : "{"timestamp":1458902366107,"active":true}"}

    get

    .get(): Object

    Gets Object from Local Storage namespace

    lsp.get(); // returns Object {timestamp: 1458902366107, active: true}

    remove

    .remove(): undefined

    lsp.remove(); // removes created data namespace

    Browsers support made by godban

    IE / Edge
    IE / Edge
    Firefox
    Firefox
    Chrome
    Chrome
    Safari
    Safari
    Opera
    Opera
    iOS Safari
    iOS Safari
    Chrome for Android
    Chrome for Android
    Edge last 2 versions last 2 versions last 2 versions last 2 versions last 2 versions last 2 versions

    Install

    npm i local-storage-parser

    DownloadsWeekly Downloads

    2

    Version

    1.1.0

    License

    MIT

    Last publish

    Collaborators

    • godban