
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
choo-persist
Advanced tools
Persist choo state to localStorage. localStorage is supported by all major browsers.
var persist = require('choo-persist')
var choo = require('choo')
var app = choo()
app.use(persist())
instance = persist([opts])
Load the app state from localStorage
and set up listeners to write the state
back on every event. Can take an optional argument of options:
'choo-persist'
; the localStorage
key.var xtend = require('xtend')
var opts = {
filter: function (state) {
state = xtend(state) // clone the object
delete state.sadArrayFilledWithFunctions
return state
}
}
$ npm install choo-persist
No; state is persisted between page reloads which might put your page in very odd states, with a very annoying way to clear. Consider using hot reloading for development instead.
Ah, this is where good ol' data persistance comes into play - there's loads of approaches on this, but yeah you should def find a way to migrate data between incompatible models. Perhaps some day we'll have a good chapter on this in the choo handbook. Until then: have fun I guess?
FAQs
Synchronize choo state with indexedDB
We found that choo-persist 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
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.