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

dublin-bus

v1.0.32

Published

Dublin Bus CLI

Downloads

19

Readme

#Dublin Bus CLI

##Introduction Command-line client for Dublin Bus. Pure NodeJS goodness for retrieving real-time information about buses across Dublin. Absolutely essential, if you use public transportation in this chronically congested city. And cool as well. After all, how many people use a terminal app to check the whereabouts of that feckin' bus? It even works on your Android phone, as shown below!

If you love it, why not rewarding me by a €2 PayPal donation? Every two and a half donation buys me a pint of the good black stuff :-)

Your name will be added to the list of donors and you'll be famous forever, as Internet never forgets!

Merci beaucoup!

Tomasz

##Output This is how it looks like. Dublin Bus loves lolcat :-)

Dublin Bus loves lolcat

##Requirements To run the application, NodeJS must be available on your system. You can find it here: https://nodejs.org/en or install using the package manager of your choice.

On Debian-based Linux machines:

sudo apt install nodejs nodejs-legacy

On Mac OS X:

brew install node

Detailed instructions here: https://nodejs.org/en/download/package-manager/

##Installation Install the application using npm, to make it available as global command

sudo npm install dublin-bus -g

If you're rather interested in source code, install it as local npm module in your preferred folder for funky projects and hacks:

npm install dublin-bus 
cd ./node_modules/dublin-bus
npm install

Alternatively you can pull the project directly from git repository:

git clone https://bitbucket.org/agilisconsultinglimited/dublin-bus.git
cd dublin-bus
npm install

##Usage

Usage: dublin-bus [options] [command]

Options:

-V, --version  output the application version number
-d, --debug    Display debug information

Commands:

stop <number>                   Displays real-time departures for the specified stop
find <text>                     Finds stop by name and displays real-time departures
                                If more matches found, you will be asked to choose.
route <number> [operator]       Displays route details and all its stops. Dublin Bus
                                operator is assumed, unless specified otherwise.
timetable <stop> <route> [day]  Displays timetable for the specified stop, route and 
                                day. If day is not specified, today is assumed.
help                            Displays help
preferences [...]               Commands for handling preferences, below more details

Examples:

dublin-bus stop 1305            Displays departures at stop 1305
dublin-bus find "Grange"        Finds stops with "Grange" in name
dublin-bus route 17             Displays details and stop list of bus route 17
dublin-bus timetable 1305 17    Displays todas timetable for stop 1305 and bus 17
dublin-bus timetable 1305 17 7  Displays Sunday timetable for stop 1305 and bus 17
dublin-bus preferences list     Displays application preferences

Shorthand syntax is available for quick lookups. Just specify bus number or name without any commands or options:

dublin-bus 1305
dublin-bus "Grange Road"    

##Cowsay mode The app works nicely with cowsay, if you only ask cowsay to keep formatting of the text it receives from dublin-bus application, by adding -n switch. Cowsay also removes all the colors, but there's always lolcat for that ;-)

Examples

dublin-bus stop 1305 | cowsay -n
dublin-bus route 104 | cowsay -n | lolcat

Isn't it cute?

Cow says Dublin Bus

##Make it work on Android phone Yes, it's possible! Follow these steps:

Launch Termux and execute the following commands to prepare the environment and NodeJS platform:

apt update && apt upgrade
apt install coreutils
apt install nodejs
apt install cowsay
node --version

The last command should display version number of the installed NodeJS platform. If it does, proceed with installing the application using the same procedure as on a desktop system. If you choose to use git method, first add git to your phone by running:

apt install git  

Go to the folder where application is installed. If you used npm method, it's:

cd node_modules/dublin-bus-cli

and for git method it's

cd dublin-bus

Launch the application using node intepreter, for example to get the bus stop 1305 information:

node dublin-bus.js 1305
node dublin-bus.js stop 1305 | cowsay -n

And this is the result:

Cow says Dublin Bus on Android Phone

##Preferences In preferences.json file you can store various default settings for the application: ###stops A list of your favourite bus stops. If specified, it will be loaded automatically, if you launch the application without any input parameters. Easy way to quickly check current departures at your usual places.

###Displaying preferences To display current preferences, use the following command:

dublin-bus preferences list     

To add or remove preferred bus stops, use the following commands:

dublin-bus preferences stop add <number>
dublin-bus preferences stop remove <number>         

Note that the above will modify preferences.json file. If you have installed the application as global command, you might receive access denied errors. Run the commands with sudo in such case:

sudo dublin-bus preferences stop add <number>
sudo dublin-bus preferences stop remove <number>