Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
stan-api
Advanced tools
Readme
Support non officiel de l'API du Service de Transport de l'Agglomération Nancéienne (STAN).
Ce module permet de récupérer:
Kind: global class
Promise.<Array.<Ligne>>
Promise.<Array.<Arret>>
Promise.<Array.<Passage>>
Promise.<Array.<Direction>>
Promise.<Array.<Arret>>
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))
Promise.<Array.<Arret>>
Liste des arrêts d'une ligne
NB: Un arret peut être commun à plusieurs lignes.
Kind: static method of Stan
Param | Type | Description |
---|---|---|
ligne | Ligne | Ligne |
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))
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
Param | Type | Description |
---|---|---|
arret | Arret | Arrê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
Promise.<Array.<Direction>>
Lister les directions d'une ligne
Kind: static method of Stan
Param | Type | Description |
---|---|---|
ligne | Ligne | Ligne |
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))
Promise.<Array.<Arret>>
Lister les arrêts sur le chemin d'une direction d'une ligne
Kind: static method of Stan
Param | Type | Description |
---|---|---|
direction | Direction | Direction d'une ligne |
FAQs
Support non officiel de l'API du Service de Transport de l'Agglomération Nancéienne (STAN)
The npm package stan-api receives a total of 0 weekly downloads. As such, stan-api popularity was classified as not popular.
We found that stan-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.