Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

glob-store

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glob-store

Key-value store with iterator and glob semantics

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by150%
Maintainers
1
Weekly downloads
 
Created
Source

glob-store.js Build Status

Key-value store with iterator and glob semantics. Allows to store multiple values per key and can be modified during iteration.

Repository: https://github.com/mantoni/glob-store.js


Install with npm

npm install glob-store

Browser compatibility

To use this module in a browser, download the npm package and then use Browserify to create a standalone version.

Usage

var Store = require('glob-store').Store;

var s = new Store();
s.add('**', 1);
s.add('a.b', 2);
s.add('a.c', 3);
s.add('a.c', 7);

var c, i = s.iterator('a.*');
while ((c = i.next()) !== undefined) {
  console.log(i.name + ': ' + c);
}

The implementation is based on glob-tree, but allows multiple values to be stored under the same key.

Store API

  • add(name, value)
  • remove(name, value)
  • removeAll([name])
  • iterator(name[, options])
  • values([name])

The iterator is derived from min-iterator and supports the same options as the glob-tree iterator:

  • matchers: whether to include matchers, defaults to true
  • onlyMatchers: whether to only include matchers, defaults to false

License

MIT

Keywords

FAQs

Package last updated on 01 Apr 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc