npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dublinbusjs

v2.0.0

Published

Get the Realtime and Stop Information from the Dublin Bus REST API

Downloads

21

Readme

Dublin Bus - RTPI Javascript Client

Dublin Bus Logo

About This

This module gets realtime and stop information from the Dublin Bus REST API. It's really simple to use just look at the examples.

Any bug reports / pull requests are welcome, just follow the contributing guide (At the end of this).

Usage Guide / Examples

You have to install the module before you can use it:

npm install --save dublinbusjs

Now this exposes two functions, getStopData() and getRealtimeData().

const dublinBus = require('dublinbusjs');

dublinBus.getStopData(3787).then(console.log).catch(console.error)

/* Prints:
{
	"stopid": "3787",
	"displaystopid": "3787",
	"shortname": "Skerries Road",
	"shortnamelocalized": "Bóthar na Sceirí",
	"fullname": "Skerries Road",
	"fullnamelocalized": "",
	"latitude": "53.54684889",
	"longitude": "-6.101198889",
	"lastupdated": "12/12/2016 09:03:15",
	"operators": [
		{
			"name": "bac",
			"routes": [
				"33",
				"33X",
				"33A"
			]
		}
	]
}
*/

dublinBus.getRealtimeData(7602).then(console.log).catch(console.error)

/* Prints:
[
	{
		"arrivaldatetime": "14/01/2017 13:16:27",
		"duetime": "43",
		"departuredatetime": "14/01/2017 13:16:27",
		"departureduetime": "43",
		"scheduledarrivaldatetime": "14/01/2017 13:21:00",
		"scheduleddeparturedatetime": "14/01/2017 13:21:00",
		"destination": "Balbriggan",
		"destinationlocalized": "Baile Brigín",
		"origin": "Abbey St",
		"originlocalized": "Sr. na Mainistreach",
		"direction": "Outbound",
		"operator": "bac",
		"additionalinformation": "",
		"lowfloorstatus": "no",
		"route": "33",
		"sourcetimestamp": "14/01/2017 12:16:31",
		"monitored": "true"
	}
]
*/

Contributing

All bug reports and pull requests are welcome! If you wish to add something, make a fix or make a change, just:

  • Fork this repo
  • Add a branch
  • Make your changes
  • Send a pull request!

Make sure to make your changes in the 'src' directory, and run gulp when your finished so it will build!