npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

divia-api

v3.0.3

Published

Divia API v3

Downloads

99

Readme

Divia API v3

API JavaScript/TypeScript non officielle pour accéder aux données temps réel du réseau de transport Divia (Dijon Métropole) : lignes, arrêts et horaires.

Installation

npm install divia-api

Importation

  • Avec ESM :
    import { listLines, listStops, getSchedules } from 'divia-api';
  • Avec CommonJS :
    const { listLines, listStops, getSchedules } = require('divia-api');

Utilisation

import { listLines, listStops, getSchedules } from './dist/divia-api.cjs';

// Récupère toutes les lignes de tramway (ou "bus") :
const lines = await listLines('tramway');
const lineT1 = lines.find((line) => line.code === 'T1');

// Récupère les arrêts d'une ligne :
const stops = await listStops(lineT1.id);
const stopRépublique = stops.find((stop) => stop.name === 'République');

// Récupère les prochains horaires pour une ligne et un arrêt :
const schedules = await getSchedules(lineT1.id, stopRépublique.id);

// Récupère les horaires pour la direction "QUETIGNY Centre" :
const scheduleDirectionQuetigny = schedules.find((s) => s.route.direction.name.startsWith('QUETIGNY Centre'));

// Affiche les 3 prochains horaires de cette direction :
const newSchedules = scheduleDirectionQuetigny.date_times.slice(0, 3);
newSchedules.forEach((s) => console.log(s.date_time));

API

listLines(mode: 'bus' | 'tramway'): Promise<LineObject[]>

Récupère la liste des lignes pour un mode de transport donné.

listStops(lineId: string): Promise<StopAreaObject[]>

Récupère la liste des arrêts pour une ligne donnée.

getSchedules(lineId: string, stopAreaId: string): Promise<ScheduleObject[]>

Récupère les prochains horaires en temps réel pour une ligne et un arrêt donnés.

Types

LineObject

| Propriété | Type | Description | |----------------|-----------------|---------------------------| | id | string | Identifiant de la ligne | | name | string | Nom de la ligne | | code | string | Code court de la ligne | | color | string | Couleur de la ligne (hex) | | text_color | string | Couleur du texte (hex) | | codes | array | Codes associés | | routes | RouteObject[] | Itinéraires de la ligne | | opening_time | Date | Heure d'ouverture | | closing_time | Date | Heure de fermeture |

StopAreaObject

| Propriété | Type | Description | |------------|----------|--------------------------------| | id | string | Identifiant de la zone d'arrêt | | name | string | Nom de l'arrêt | | codes | array | Codes associés | | timezone | string | Fuseau horaire | | label | string | Libellé de l'arrêt | | coord | object | Coordonnées (lon, lat) |

ScheduleObject

| Propriété | Type | Description | |------------------------|--------------------|----------------------------| | stop_point | StopPointObject | Point d'arrêt associé | | route | RouteObject | Itinéraire associé | | display_informations | object | Informations d'affichage | | date_times | DateTimeObject[] | Horaires associés | | links | object[] | Liens associés | | first_datetime | DateTimeObject | Premier horaire disponible | | last_datetime | DateTimeObject | Dernier horaire disponible |

Fonctionnement

L'API utilise l'infrastructure Navitia via un proxy presigné (nws-main.hove.io). L'authentification est gérée automatiquement via un token chiffré AES-GCM dérivé par PBKDF2. Aucune clé API n'est nécessaire côté utilisateur.

Les données temps réel sont récupérées via les endpoints terminus_schedules de l'API Navitia pour la couverture fr-ne-dijon.

Licence

Licence MIT

Copyright (c) 2026 gauthier-th ([email protected])