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

sanntid

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sanntid

Sanntid.js is a node.js module for getting real-time data from the public Ruter API.

  • 1.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

Sanntid.js

Sanntid.js is a node.js module for getting real-time data from the public Ruter API.

Installation

Simply do

npm install sanntid

Use the -g option to make the command globally available as sanntid.

How to work it

As a CLI

./sanntid.js <locationID>

Or you can search for a location:

./sanntid.js sofienberg

The result would be something like this:

🚋  17 Rikshospitalet - in 2 minutes
🚌  31 Snarøya - in 2 minutes

A list of locations and their IDs can be downloaded from Ruter lab's pages.

You can limit the results to a specific direction by specifying 1 or 2 as the second parameter:

./sanntid.js sofienberg 1

As a node module

var sanntid = require('./sanntid'),
	allLocations = sanntid.list(),
	locations = sanntid.search('sofienberg');

for (var i = 0; i < locations.length; i++) {
	sanntid.getRealtimeData(locations[i], '1', function (data) {
	    console.log(data);
	});
}

Testing

Run the tests using the npm test command:

npm test

License

The MIT License

Copyright © 2015 - Mathias Novas

Keywords

FAQs

Package last updated on 22 Jan 2018

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