New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

plannerjs

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

plannerjs

The JavaScript framework for journey planning.

latest
Source
npmnpm
Version
0.4.2
Version published
Maintainers
2
Created
Source

Planner.js: A JS library for route planning

🛸️ Build Status 🚴 MIT License 🚉 npm version 🚀

$ npm install plannerjs

Include it in the browser:

<script src="https://planner.js.org/js/planner-latest.js"></script>

...

<script>
  const { FlexibleTransitPlanner, Units } = PlannerJS;
</script>

Include it in your JavaScript project:

const { FlexibleTransitPlanner, Units } = require('plannerjs');

// or

import { FlexibleTransitPlanner, Units } from 'plannerjs';

Use it in both environments:

const planner = new FlexibleTransitPlanner();
planner.addConnectionSource("https://graph.irail.be/sncb/connections");
planner.addStopSource("https://irail.be/stations/NMBS");

planner.query({
  from: "http://irail.be/stations/NMBS/008812005", // Brussels North
  to: "http://irail.be/stations/NMBS/008892007", // Ghent-Sint-Pieters
  minimumDepartureTime: new Date(),
  
  walkingSpeed: 3, // KmH
  minimumWalkingSpeed: 3, // KmH
 
  maximumWalkingDistance: 200, // meters
  
  minimumTransferDuration: Units.fromMinutes(1),
  maximumTransferDuration: Units.fromMinutes(30),
  
  maximumTravelDuration: Units.fromHours(1.5),
  
  maximumTransfers: 4,
})
  .take(3)
  .on('data', (path) => {
   console.log(JSON.stringify(path, null, 4));
  })
  .on('end', () => {
    console.log('No more paths!')
  })
  .on('error', (error) => {
    console.error(error);
  });

Documentation

For further instructions, follow the documentation at https://planner.js.org/

Developing

  • Building the docs with typedoc: npm run doc
  • Testing with jest: npm test
  • Build a new browser version with npm run browser
  • Bundle the latest planner for the docs example npm run doc-bundle

FAQs

Package last updated on 21 Feb 2023

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