
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
js-data-localstorage
Advanced tools
localStorage adapter for js-data.
Tested on IE9, Chrome 46, Firefox 41 & Safari 7.1 using
https://js-data-localstorage.firebaseapp.com/
npm install --save js-data js-data-localstorage
or bower install --save js-data js-data-localstorage
.
Load js-data-localstorage.js
after js-data.js
.
var adapter = new DSLocalStorageAdapter();
var store = new JSData.DS();
store.registerAdapter('localstorage', adapter, { default: true });
// "store" will now use the localstorage adapter for all async operations
You can also provide a custom storage medium (it just needs to implement the localStorage
API):
var memory = {};
// Turn js-data-localstorage into an in-memory adapter
var memoryAdapter = new DSLocalStorageAdapter({
storage: {
getItem: function (key) {
return memory[key];
},
setItem: function (key, value) {
return memory[key] = value;
},
removeItem: function (key) {
delete memory[key];
}
}
});
// Turn js-data-localstorage into a sessionStorage adapter
var sessionAdapter = new DSLocalStorageAdapter({
storage: sessionStorage
});
First, support is handled via the Slack Channel and the Mailing List. Ask your questions there.
When submitting issues on GitHub, please include as much detail as possible to make debugging quick and easy.
git clone git@github.com:<you>/js-data-localstorage.git
cd js-data-localstorage; npm install;
npm test
(build and test)dist/
folder & files will be generated, do NOT commit dist/*
! They will be committed when a release is cut.The MIT License (MIT)
Copyright (c) 2014-2015 Jason Dobry
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2.3.2 - 12 December 2015
FAQs
localStorage adapter for js-data.
The npm package js-data-localstorage receives a total of 35 weekly downloads. As such, js-data-localstorage popularity was classified as not popular.
We found that js-data-localstorage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.