You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simple Key/Value storage atop chrome.storage. For Chrome extensions.
Rationale
Default chrome.storage api is a pain to deal with when it comes to
things like updating or removing specific values in hashes, since you
can only save or load a whole hash at a time.
I believe this is by design as the use-case it was designed for was
probably simply saving and loading a user's settings for an extension.
This is fine for most use-cases, but if you are programmatically storing
a collection of items that changes over time, then this lib
should prove more convenient.
Installation
$ component install timoxley/chrome-keyvalue
Example
varassert=require('assert')varKeyValue=require('chrome-keyvalue')// create a new instance for 'users'varkv=newKeyValue('users')kv.set('tim',{// save a username: 'Tim',age: 27},function(err,val){assert.ifError(err)assert.equal(val.name,'Tim')// get the record we just savedkv.get('tim',function(err,val){assert.ifError(err)assert.equal(val.name,'Tim')assert.equal(val.age,27)done()})})