Created
May 30, 2017 20:27
-
-
Save peisenhower/c6ee2fc17e1545e420b689e696a14a0f to your computer and use it in GitHub Desktop.
node quick filter, run in node REPL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
/* Load sample data */ | |
sample = require('./junk.sample.json'); | |
/* filter data down */ | |
filtered = sample.filter((x) => x.color == 'blue' && x.gain == 'high'); | |
/* save data to file */ | |
fs.appendFile('output', JSON.stringify(filtered)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment