eyedact
Advanced tools
Comparing version 0.4.0 to 0.4.1
{ | ||
"name": "eyedact", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Freeze-dried searches from text mind maps", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -0,1 +1,3 @@ | ||
[![npm version](https://badge.fury.io/js/eyedact.svg)](https://badge.fury.io/js/eyedact) | ||
Make freeze-dried web searches using text mind-maps. | ||
@@ -2,0 +4,0 @@ |
@@ -5,20 +5,20 @@ const opn = require('opn'); | ||
module.exports = function eyedact({haystack, lucky, openall, needles}) { | ||
const stream = createMindMapReadStream({ | ||
infile: haystack, | ||
searchstrings: needles, | ||
}); | ||
const stream = createMindMapReadStream({ | ||
infile: haystack, | ||
searchstrings: needles, | ||
}); | ||
stream.on('mindmatch', function(stack) { | ||
const url = `https://www.google.com/search?q=${stack.join('+')}`; | ||
opn(lucky ? url + '&btnI': url); | ||
stream.on('mindmatch', function(stack) { | ||
const url = `https://www.google.com/search?q=${stack.join('+')}`; | ||
opn(lucky ? url + '&btnI': url); | ||
if (!openall) { | ||
stream.removeAllListeners('mindmatch'); | ||
stream.close(); | ||
} | ||
}); | ||
if (!openall) { | ||
stream.removeAllListeners('mindmatch'); | ||
stream.close(); | ||
} | ||
}); | ||
stream.flow(); | ||
stream.flow(); | ||
return stream; | ||
return stream; | ||
} |
Sorry, the diff of this file is not supported yet
10027
193