Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lsjroberts/node-national-rail
Network Rail node package
https://github.com/lsjroberts/node-national-rail
Last synced: 6 days ago
JSON representation
Network Rail node package
- Host: GitHub
- URL: https://github.com/lsjroberts/node-national-rail
- Owner: lsjroberts
- License: mit
- Created: 2014-07-24T22:51:39.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-07-24T23:45:31.000Z (over 10 years ago)
- Last Synced: 2024-04-15T22:39:33.498Z (7 months ago)
- Language: JavaScript
- Size: 121 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# National Rail - Node
This is a node package for interacting with the [National Rail](http://nationalrail.co.uk) api.
It comes with a tool for accessing this data directly via the command line, or can be used within your own projects.
## Installation
Install with:
```
$ npm install -g national-rail
```_move binary to /usr/local/bin ?_
## Command-line Tool
...
## Using the package in your own projects
Require the national-rail package as usual:
```js
var rail = require('national-rail');
```Since each command sends a request to the National Rail api, the response is returned in a promise. For example, to get ??? you can call:
```js
rail.???.status({
'incidents': true,
}).then(function(???) {
console.log(???);
});
```The function passed into `then()` will be called asynchronously once the request to the api has returned and been processed.
### Services
...