Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
backbone.localstorage
Advanced tools
Readme
An adapter that replaces Backbone.sync
to save to window.localStorage
instead of to the server.
Note Backbone LocalStorage v2 changes the API to work more with ES6 modules. See Upgrade Notes for more details.
Import backbone.localstorage
and attach it to your models and collections:
import {Collection, Model} from 'backbone';
import {LocalStorage} from 'backbone.localstorage';
const SomeCollection = Collection.extend({
localStorage: new LocalStorage('SomeCollection'), // Uniquely identify this
});
const SomeModel = Model.extend({
localStorage: new LocalStorage('SomeModel')
});
To synchronise with the server, you can pass the ajaxSync
flag to any options:
const myModel = new SomeModel();
myModel.fetch({
ajaxSync: true // Fetches from the server
});
myModel.save({
new: "value"
}, {
ajaxSync: true // Pushes back to the server
});
Backbone LocalStorage is now built using ES6. It should be fully compatible with
v1 with one difference: Instead of exporting the LocalStorage
class as a
default module, v2 exports it as a named variable. Below are examples covering
the changes:
In v1:
var LocalStorage = require('backbone.localstorage');
In v2:
var localStorage = require('backbone.localstorage');
var LocalStorage = localStorage.LocalStorage;
In v1:
import LocalStorage from 'backbone.localstorage';
In v2:
import {LocalStorage} from 'backbone.localstorage';
Install NodeJS and run yarn
or npm i
to get your dependencies, then:
npm test
FAQs
[![Build Status](https://travis-ci.org/jeromegn/Backbone.localStorage.svg?branch=master)](https://travis-ci.org/jeromegn/Backbone.localStorage) [![Coverage Status](https://coveralls.io/repos/github/jeromegn/Backbone.localStorage/badge.svg?branch=master)](
The npm package backbone.localstorage receives a total of 4,728 weekly downloads. As such, backbone.localstorage popularity was classified as popular.
We found that backbone.localstorage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.