Skip to content

Instantly share code, notes, and snippets.

@peisenhower
Created May 30, 2017 20:27
Show Gist options
  • Save peisenhower/c6ee2fc17e1545e420b689e696a14a0f to your computer and use it in GitHub Desktop.
Save peisenhower/c6ee2fc17e1545e420b689e696a14a0f to your computer and use it in GitHub Desktop.
node quick filter, run in node REPL
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