Skip to content

timmak/localstore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

browser support

#LocalStore

Local storage library with pull stream api.

##Example

  var request = require('hyperquest');
  var pull = require('pull-stream');
  var pullable = require('stream-to-pullstream');
  var store = require('localstore');

  var pullbaleRequest = pullable(request.get(https://api.github.com/repos/substack/hyperquest))

  //Save the body of the request
  pullableRequest.pipe(store.set('substack.hyperquest'));

  //Get and log request to output
  store.get('substack.hyperquest').pipe(pull.log());

##Methods

  var store = require('store');

###Store.set(key)

Set is a sink stream therefore there can only be one store set in the pipe.

###Store.get(key)

Get is source stream you can pull from it. It must be at the start of a pipeline.

  store.get('key').pipe(sink())

##Store JSON

local store currently doesn't have and will not support storing values as JSON. It is recommend that you use a json stream transfomer for performing such opperation.

About

Local Storage pull stream api for the browser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published