Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

earthquake-emitter

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

earthquake-emitter

I emit `earthquake` events with data about the location and magnitude.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

earthquake-emitter

I emit earthquake events with data about the location and magnitude.

Usage:

  var quakes = new EarthquakeEmitter()
  quakes.on('earthquake', (q) => console.log(q.properties.title))
  // M 2.6 - 8km NW of Gerlach-Empire, Nevada

Internally, I poll http://earthquake.usgs.gov for geojson data of quakes in the last 2.5 days. I store the quake ids from the last response, and compare it with the new response to figure out which quakes are new, and emit those ones.

An average earthquake payload looks a bit like this: (there are many other properties)

{
  type: 'Feature',
  properties: {
    mag: 4.7,
    place: '13km NNW of Kandrian, Papua New Guinea',
    time: 1461410344330,
  },
  geometry: {
    type: 'Point',
    coordinates: [ 149.5163, -6.101, 61.89 ]
  },
  id: 'us20005l6g'
}

A (╯°□°)╯︵TABLEFLIP side project.

Keywords

FAQs

Package last updated on 24 Apr 2016

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