Streaming OpenStreetMap PBF parser for Node.js. Version 1.1.4. Parses .osm.pbf files into a readable stream of OSM entities (header, nodes, ways, relations). Built for modern Node (16.13+). Exports an async generator (createOSMStream) and a Transform class (OSMTransform). Supports filtering tags per entity type, raw PBF blocks, and optional metadata. Ships TypeScript definitions.
npm install osm-pbf-parser-nodeNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Parses an .osm.pbf file and writes each OSM entity as a JSON line to an output file.
Use Node 16.13+; if in CommonJS, use dynamic import: const { createOSMStream } = await import('osm-pbf-parser-node');Pass { withInfo: true } if you need metadata fields.Download the .pbf file first, then parse from local path.
Upgrade to 1.x: use createOSMStream instead of older synchronous parse function.
Convert to ESM or use dynamic import: const { createOSMStream } = await import('osm-pbf-parser-node');Use named import: import { createOSMStream } from 'osm-pbf-parser-node';Run npm install and ensure pbf is in node_modules. If corrupted, delete node_modules and reinstall.