Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including javascript-storage with all npm packages installed. Try it out:

var javascriptStorage = require("javascript-storage")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

javascript-storage v1.0.0

local storage wrapper

javascript-storage

хелпер для работы с localStorage

Установка

$ npm install javascript-storage

Надо настроить в вашем сервере резолв с /javascript-storage в node_modules/javascript-storage

  <script type="importmap">
  {
    "imports": {
      "javascript-storage": "/javascript-storage/index.js"
    }
  }
  </script>

Использование

import Storage from 'javascript-storage';

const storage = new Storage();

storage.set(name, data); //
storage.get(name);       // data
storage.remove(name);    //
storage.clear();         //
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free