meteor-better-storage
v2.0.2
Published
Store JavaScript objects using Meteor's localStorage utility.
Downloads
7
Maintainers
Readme
Better Local Storage for Meteor
A very simple wrapper around Meteor's _localStorage
interface enabling conversion and storage of JavaScript objects.
Install
npm i meteor-better-storage
Import
import BetterStorage from 'meteor-better-storage';
Example use
// Set a value
BetterStorage.set('my-key', { my: 'value' });
// Fetch a value
BetterStorage.fetch('my-key'); // => { my: 'value' }
// Remove object
BetterStorage.remove('my-key');
BetterStorage.fetch('my-key') // => null
Methods
Store item
BetterStorage.set('some-key', { some: 'value' });
Fetch item
BetterStorage.fetch('some-key');
Remove item
BetterStorage.remove('some-key');
License
This repository is licensed under the ISC license.
Copyright (c) 2019, Jørgen Vatle.