Created
June 14, 2022 19:04
-
-
Save benjamingr/456e7283411df0d75cad66e6d50282db to your computer and use it in GitHub Desktop.
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
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