1.0.0 • Published 9 years ago

transilien v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

transilien

Get the status (ok or ko) of the railways traffic according Lines.

Keynote

Get the status (ok or ko) of the railways traffic according Lines.

Install

$ npm install --save transilien

Usage

var transilien = require('transilien');

// Get traffic status for all Lines
transilien.lignes(callback);

// Get traffic status for Lines L and U
transilien.lignes(["L","U"],callback);

Callback results example

[{
	"line": "L",
	"status": "ok",
	"message": "Trafic normal"
},
{
	"line": "N",
	"status": "nok",
	"message": "Ligne N : retards Paris Montparnasse - Dreux"
}]

Methods

transilien.lignes([code],callback)

With

  • code, optional, array containing list of Lines code
  • callback with error return and Lines traffic status results.

Status Schema

{
	"title": "Line status",
	"type": "object",
	"properties": {
		"line": {
			"type": "string",
			"description": "Code line"
		},
		"status": {
			"type": "string",
			"description": "Traffic status"
		},
    "message": {
      "type": "string",
			"description": "Traffic message"
    }
	},
	"required": ["line", "status", "message"]
}

JSON Example

{
  "line": "L",
  "status": "ok",
  "message": "Trafic normal"
}

License

MIT © Yassine AZZOUT