Socket
Socket
Sign inDemoInstall

stan-api

Package Overview
Dependencies
23
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    stan-api

Support non officiel de l'API du Service de Transport de l'Agglomération Nancéienne (STAN)


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
1.37 MB
Created
Weekly downloads
 

Readme

Source

Stan

Support non officiel de l'API du Service de Transport de l'Agglomération Nancéienne (STAN).

Ce module permet de récupérer:

  • les prochains passages
  • les lignes
  • les directions
  • les arrêts

Kind: global class

  • Stan
    • .getLignes()Promise.<Array.<Ligne>>
    • .getArrets(ligne)Promise.<Array.<Arret>>
    • .getProchainsPassages(arret)Promise.<Array.<Passage>>
    • .getDirections(ligne)Promise.<Array.<Direction>>
    • .getArretsDirection(direction)Promise.<Array.<Arret>>

Stan.getLignes() ⇒ Promise.<Array.<Ligne>>

Lister les lignes du réseau de transport

Kind: static method of Stan
Example

const { Stan } = require('stan-api')

Stan.getLignes().then(lignes => console.log(lignes))

Stan.getArrets(ligne) ⇒ Promise.<Array.<Arret>>

Liste des arrêts d'une ligne

NB: Un arret peut être commun à plusieurs lignes.

Kind: static method of Stan

ParamTypeDescription
ligneLigneLigne

Example

const { Stan } = require('stan-api')

const ligneT4 = {
  id: 2332,
  numlignepublic: 'T4',
  osmid: 'line:GST:4-97',
  libelle: 'Tempo 4 - Laxou CLB <> Houdemont Porte Sud'
}
Stan.getArrets(ligneT4).then(arrets => console.log(arrets))

Stan.getProchainsPassages(arret) ⇒ Promise.<Array.<Passage>>

Lister les prochains passages d'un arrêt avec le temps d'attente estimé. Il n'est pas nécessaire de préciser une ligne, on récupère alors tous les passages des lignes desservants l'arrêt

Kind: static method of Stan

ParamTypeDescription
arretArretArrêt

Example

const { Stan } = require('stan-api')

const arret = {
  ligne: {
    id: 2332,
    numlignepublic: 'T4',
    osmid: 'line:GST:4-97',
    libelle: 'Tempo 4 - Laxou CLB <> Houdemont Porte Sud'
  },
  libelle: 'Place Stanislas - Dom Calmet',
  osmid: 'stop_point:GST:SP:NYPCL1'
}
Stan.getProchainsPassages(arret).then(p => {
  console.log(`Liste des prochains passages de l'arrêt "${arret.libelle}" de la ligne ${arret.ligne.numlignepublic}:
${p.map(passage => `${passage.direction} - Temps d'attente: ${Math.trunc(passage.temps_min/60)}H${passage.temps_min%60}min`).join('\n')}`)
})
Exemple sortie:
Liste des prochains passages de l'arrêt "Place Stanislas - Dom Calmet" de la ligne T4:
Direction Houdemont Porte Sud - Temps d'attente: 0H1min
Direction Houdemont Porte Sud - Temps d'attente: 0H8min
Direction Laxou Champ-le-Boeuf - Temps d'attente: 0H1min
Direction Laxou Champ-le-Boeuf - Temps d'attente: 0H8min

Stan.getDirections(ligne) ⇒ Promise.<Array.<Direction>>

Lister les directions d'une ligne

Kind: static method of Stan

ParamTypeDescription
ligneLigneLigne

Example

const { Stan } = require('stan-api')

const ligneT4 = {
  id: 2332,
  numlignepublic: 'T4',
  osmid: 'line:GST:4-97',
  libelle: 'Tempo 4 - Laxou CLB <> Houdemont Porte Sud'
}
Stan.getDirections(ligneT4).then(directions => console.log(directions))

Stan.getArretsDirection(direction) ⇒ Promise.<Array.<Arret>>

Lister les arrêts sur le chemin d'une direction d'une ligne

Kind: static method of Stan

ParamTypeDescription
directionDirectionDirection d'une ligne

Keywords

FAQs

Last updated on 17 Feb 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc