New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

geojson-stream-whatwg

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

geojson-stream-whatwg

stream features into and out of geojson, using the streams api.

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
16
decreased by-46.67%
Maintainers
1
Weekly downloads
 
Created
Source

geojson-stream-whatwg

Stream features into and out of GeoJSON objects and Feature Collections. Little more than @streamparser/json with pre-filled settings.

This package is a simple rewrite of Tom MacWrights geojson-stream build on the Streams API.

Installation

npm install geojson-stream-whatwg

API

geojsonStream.stringify()

Returns a transform stream that accepts GeoJSON Feature objects and emits a stringified FeatureCollection.

geojsonStream.parse()

Returns a transform stream that accepts a GeoJSON FeatureCollection as a stream and emits Feature objects.

Example

const response = await fetch('https://example.com/buildings.geojson');
const readableStream = response.body
  .pipeThrough(new TextDecoderStream())
  .pipeThrough(geojsonStream.parse())

  for await (const feature of readStream) {
    console.log(feature)
  }  

Please consult the test file located at test/basic.mjs for more examples.

License

MIT

FAQs

Package last updated on 18 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc