New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

map-reduce

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

map-reduce - npm Package Compare versions

Comparing version 2.1.2 to 2.1.3

2

package.json
{
"name": "map-reduce",
"description": "map-reduce on leveldb",
"version": "2.1.2",
"version": "2.1.3",
"homepage": "https://github.com/dominictarr/map-reduce",

@@ -6,0 +6,0 @@ "repository": {

@@ -98,3 +98,2 @@ # Map Reduce for leveldb (via levelup)

city: Oakland | New York | Berlin | Phnom Penh, etc...
street: ...,
type: taco | chili-dog | doner | noodles, etc...

@@ -128,7 +127,3 @@ }

db.mapReduce.add({
name : 'example', //defaults to 'default'
start : '', //defaults to ''
end : '~', //defaults to '~'
//map-reduce uses ~ to prefix special data,
//because ~ is the last ascii character.
name : 'streetfood',
map : function (key, value, emit) {

@@ -141,3 +136,3 @@ //perform some mapping.

emit(
[obj.country, obj.state || '', obj.city, obj.street],
[obj.country, obj.state || '', obj.city],
//notice that we are just returning a string.

@@ -173,7 +168,20 @@ JSON.stringify(obj.type)

})
```
then query it like this:
``` js
//pass tail: false, because new streetfood doesn't appear that often...
db.mapReduce.view('streetfood', {start: ['USA', 'CA'], tail: false})
.pipe(...)
//or get the streetfood counts for each state.
//we want to know about realtime changes this time.
db.mapReduce.view('streetfood', {start: ['USA', true]})
```
## License
MIT
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