Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sncf.js

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sncf.js

An easy to use javascript module to get all the information in real time about the trains ©SNCF (only in France)

  • 2.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

SNCF.js

About

SNCF.js is an JavaScript library to get all the information in real time about the ©SNCF a French company. It is based on the official api of the SNCF.

  • Currently under development
  • Easy to use
  • Open to any request
  • It is not an official library, but we use the official SNCF API to get our data.

Getting started

Install the library with npm:
npm i sncf.js
Get your SNCF Token:

https://www.digital.sncf.com/startup/api/token-developpeur

Documentation

Start to use the api:

JS

// Call the module
const {Client} = require('sncf.js');
// init the module
const sncf = new Client();

// Login to the SNCF api
sncf.login("YOUR TOKEN").then(async () =>{
    // The client was connected !
}).catch(err => {
    // Oups, something went wrong, Check your console
    console.log(err)
})
Functions available:
// Places
sncf.places.search('STATION_NAME') // Search for a station
sncf.places.get('STATION_ID') // Get a specific station

//Routes
sncf.routes.search('ROUTE_NAME') // Search for a route
sncf.routes.get('ROUTE_ID') // Get a specific route
sncf.routes.stop_areas('ROUTE_ID') // Get the stop areas of a specific route

// User (Get the information about the current session)
sncf.user // Get all informations
sncf.user.id // Get the user id
sncf.user.readyAt // Get the time when the client is ready
sncf.user.connectionType // Get the connection type
sncf.user.shape // Get the shape of the client
sncf.user.uptime // Get the uptime of the client
sncf.user.timezone // Get the timezone of the client

*** all functions are async ***

Need help ?

Keywords

FAQs

Package last updated on 03 Aug 2022

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc