Skip to content

Instantly share code, notes, and snippets.

@benjamingr
Created June 14, 2022 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benjamingr/456e7283411df0d75cad66e6d50282db to your computer and use it in GitHub Desktop.
Save benjamingr/456e7283411df0d75cad66e6d50282db to your computer and use it in GitHub Desktop.
import { default as parser } from 'stream-json';
import { Readable } from 'stream';
const parkingViolations = await fetch('https://s3.amazonaws.com/philadelphia-parking-violations-raw-data/parking_violations_2017.json');
await Readable.fromWeb(parkingViolations.body)
.pipe(parser())
.filter(violation => violation.name === 'stringChunk')
.map(x => x.value)
.take(5)
.forEach(v => console.log(v));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment