3.0.4 • Published 4 years ago

node-jcdecaux v3.0.4

Weekly downloads
7
License
MIT
Repository
github
Last release
4 years ago

Build Status NPM version Dependency Status

nodejs client for JCDecaux Open Data

This project is a client libray for JC Decaux Open Data. In order to use this API, you need to get a key at http://developer.jcdecaux.com.

Installation

$ npm install node-jcdecaux

historic:

see historic

Usage

var JCDecaux = require('node-jcdecaux').JCDecaux;
var Api = new JCDecaux(APIKEY)

/!\ for old nodejs or for browser, include a promise polyfill (promise-polyfill, yaku) or es6-shim

Features

All method return promise.

constructor(apiKey, options)

The first parameter is required. All others are optional

  • apiKey - api key (for get a key go http://developer.jcdecaux.com) - Required
  • options - options :
    • contractName - set the default contract for all method - Optional
    • urlApi - url of JCDecaux api (default: https://api.jcdecaux.com/vls/v1/) - Optional
    • timeout - Integer containing the number of milliseconds to wait for a request to respond before aborting the request

getContracts()

Get the contract list

getStation(stationId, contractName)

Get station information

  • stationId - id of the station - Required
  • contractName - contract name - Optional if set on init

getStations()

Get the station list

getStationsByContract(contractName)

Get the stations of a contract

  • contractName - contract name - Optional if set on init

Example

var JCDecaux = require('node-jcdecaux').JCDecaux;
var apiKey = 'your api key';

var Api = new JCDecaux(apiKey);

Api.getContracts().then(function(result) {
  console.log(result);
});

Run tests

APIKEY=yourapikey npm test

Authors

License

MIT

3.0.4

4 years ago

3.0.3

5 years ago

3.0.2

5 years ago

3.0.0

7 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.1.4

10 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago