This package has been deprecated

Author message:

This package has been moved into the '@openrailuk' scope as '@openrailuk/referencedata' and can be found at https://www.npmjs.com/package/@openrailuk/referencedata

openraildata-referencedata

1.9.0 • Public • Published

openraildata-referencedata

GitHub issues npm GitHub license David David sheilds

A package for accessing the the UK National Rails reference data FTP server aswell as some helper functions to process and use the reference data

this is a work in progress so stuff may change without warning

installation

  1. install npm
  2. npm install openraildata-referencedata --save

table of contents

getting started

this package downloads and parses the xml reference data from the National Rail ftp server and parses into JSON for use on a Node.JS application. The package also provide some helper functions for retreiving the reference data.

the reference data contains information about locations, train operating companies, reason codes, and daily timetables among other information for the UK rail network.

to use openraildata-referencedata you first need to supply the ftp password for your account found on the my feeds section of the National Rail Data Portal

const refData = require('openraildata-referencedata');

refData.connect('ftpUserPassword');

a simple example of getting the v3 reference data:

const refData = require('openraildata-referencedata');

refData.connect('ftpUserPassword');
refData.on('ready', () => {
  refData.getCurrentV3().then((v3RefData) => {
    console.log(v3RefData);
  }).catch((err) => {
    console.log(err);
  });
});

package docs

code docs found here

dev notes

Hi :D

this package is being coded while im experimenting so feel free to use it however it may change at any moment. I'm publishing it as i go so not all features will be there.

I'm generaly only working on this while im sat on the train too and from my day job so this may take a while

Readme

Keywords

none

Package Sidebar

Install

npm i openraildata-referencedata

Weekly Downloads

0

Version

1.9.0

License

MIT

Last publish

Collaborators

  • carboncollins