Giter VIP home page Giter VIP logo

hafas-discover-stations's Introduction

hafas-discover-stations

Pass in a HAFAS client, discover stops/stations by querying departures. It tries to find all stops/stations that all trains known by the endpoint stop at.

npm version ISC-licensed minimum Node.js version support me via GitHub Sponsors chat with me on Twitter

Installing

npm install hafas-discover-stations

Usage

import {createWalkAndDiscoverStations as createWalk} from 'hafas-discover-stations'
import {createClient as createHafas} from 'hafas-client'
import {profile as dbProfile} from 'hafas-client/p/db/index.js'

const hafas = createHafas(dbProfile, 'my-awesome-program')
const walk = createWalk(hafas)

const berlinFriedrichstr = '8011306' // where to start
for await (const stopOrStation of walk(berlinFriedrichstr)) {
	console.log(stopOrStation)
}

walk() returns a readable stream in object mode. It emits the following events:

  • data: a new stop/station that has been discovered
  • stats: an object with the following keys:
    • stopsAndStations: the number of stops/stations discovered
    • edges: the number of edges discovered
    • totalReqs: the number of requests sent
    • avgReqDuration: the average duration of the last 30 requests
    • queuedReqs: the number of queued requests
  • edge: a connection between two stops/stations, with the following keys:

API

walk(stationId, [opt])

opt may have the following keys. It will be passed into queue().

  • concurrency: number of requests run in parallel – default: 2
  • timeout: timeout for a single job in milliseconds – default: 10000
  • parseStationId: an optional function to process station IDs – default: id => id
  • stationLines: Query lines of stops/stations? – default: false
  • shouldQueryDeparturesAt(stopId, nrOfHops): Should departures be queries from this stopId, effectively continuing the graph search? – default: () => true

Contributing

If you have a question or need support using hafas-discover-stations, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, use the issues page.

hafas-discover-stations's People

Contributors

derhuerst avatar greenkeeper[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

lemnis

hafas-discover-stations's Issues

An in-range update of queue is breaking the build 🚨

The dependency queue was updated from 4.5.0 to 4.5.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

queue is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 5 commits.

  • c76211c 4.5.1
  • f5676ad Merge pull request #53 from mszewcz/master
  • 1f02cdb Merge pull request #52 from kwolfy/master
  • 5b6368e Added missing props to IQueueOptions
  • 8020511 fix #50 promise warning

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of luxon is breaking the build 🚨

The dependency luxon was updated from 1.7.1 to 1.8.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

luxon is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 1 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of luxon is breaking the build 🚨

The dependency luxon was updated from 1.4.5 to 1.4.6.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

luxon is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 4 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of ansi-escapes is breaking the build 🚨

The dependency ansi-escapes was updated from 3.1.0 to 3.2.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

ansi-escapes is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v3.2.0
  • Add .clearTerminal to clear the whole terminal, not just visible part of it (#6) 9d3a0c8
Commits

The new version differs by 2 commits.

  • e6a876d 3.2.0
  • 9d3a0c8 Add .clearTerminal to clear the whole terminal, not just visible part of it (#6)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of mri is breaking the build 🚨

The dependency mri was updated from 1.1.1 to 1.1.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

mri is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 8 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of luxon is breaking the build 🚨

The dependency luxon was updated from 1.4.1 to 1.4.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

luxon is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 5 commits.

  • 50e5b82 bump to 1.4.2
  • fc038d5 handle BCP 47 extensions in the locale string
  • b2a5fba add support for the [weekYear]-W[weekNumber] ISO format
  • 0a31dd8 reworking linting/formatting
  • c7c05a5 double quotes

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of luxon is breaking the build 🚨

The dependency luxon was updated from 1.4.2 to 1.4.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

luxon is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 1 commits.

  • 24713e1 don't bury errors from bad locale strings

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of luxon is breaking the build 🚨

The dependency luxon was updated from 1.6.2 to 1.7.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

luxon is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 8 commits.

  • 73f04cf bump to 1.7.0
  • 733e467 fix rounding for toFormat('X') and clean up rounding in general
  • 1c10cfb update docs to reflect that zone isn't public
  • 17a09a8 Update zones.md
  • e7f98e5 grammar fix for matrix.md
  • ff425d5 removing vscode
  • c1b2d44 Fix milliseconds formatting example in readme. (#366)
  • ae074cc locking down prettier and fixing my precommit hooks

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of luxon is breaking the build 🚨

The dependency luxon was updated from 1.3.3 to 1.4.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

luxon is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 9 commits.

  • 6b17d70 bump to 1.4.0
  • 383ad88 Add X and x tokens to toFormat that return the Date in epoch seconds and milliseconds respectively (#319)
  • 9552ed7 accept single-section iana zones
  • d613f61 bug fix for Etc/GMT timezones (#327)
  • 873de15 doc fixes for tokens
  • 41f6d12 upgrade to babel 7
  • 55ac17e remove inspect altogether
  • 5b1e605 bump dev env to node 10
  • 4d3f464 Add docs and tests for padded duration formats

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

fix race condition

From Travis CI:

node test.js
Error: stream.push() after EOF
    at readableAddChunk (_stream_readable.js:240:30)
    at Readable.push (_stream_readable.js:208:10)
    at onStops (/home/travis/build/derhuerst/hafas-discover-stations/index.js:94:9)
    at onLeg (/home/travis/build/derhuerst/hafas-discover-stations/index.js:127:4)
    at hafas.trip.then (/home/travis/build/derhuerst/hafas-discover-stations/index.js:137:5)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)

An in-range update of luxon is breaking the build 🚨

The dependency luxon was updated from 1.8.0 to 1.8.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

luxon is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 3 commits ahead by 3, behind by 1.

  • 93a8fdc rereleasing as 1.8.1
  • f38823e bump to 1.8.0
  • af1c686 Add support for Unix timestamps in seconds. (#371)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

An in-range update of luxon is breaking the build 🚨

The dependency luxon was updated from 1.19.3 to 1.20.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

luxon is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 8 commits.

  • 0763b1e bump to 1.20.0
  • 969246a add some caching benchmarks
  • 93b41a9 Fixed truncated summary issue (#597)
  • 5c265a4 Use "numeric" instead of "2-digit" in formatting presets (#593)
  • df59f67 Add Duration#mapUnits (#592)
  • cad152a fix changelog headings
  • 7d3dc31 Issue #492. Added methods toISODate, toISOTime to Interval (#583)
  • 6dc1878 Format override example has incorrect code (#581)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of through2 is breaking the build 🚨

The devDependency through2 was updated from 2.0.3 to 2.0.4.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

through2 is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 4 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of luxon is breaking the build 🚨

The dependency luxon was updated from 1.4.3 to 1.4.4.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

luxon is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 8 commits.

  • 97f0efb bump to 1.4.4
  • aa70f54 Interval.fromISO to allow relative durations. (#341)
  • ce3ae7a Fixes DateTime.toRFC2822 using 12h instead of 24h format (#344)
  • 55eccc5 provisionally fix lint
  • fc3ea1e Fix grammatical error in time zone docs (#346)
  • 6a88ee8 update package-lock
  • 747d327 improve Settings.now docs
  • 6d99133 bump and remove dependency

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of luxon is breaking the build 🚨

The dependency luxon was updated from 1.4.4 to 1.4.5.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

luxon is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 3 commits.

  • d658968 fix minified builds
  • cc73799 Update DateTime#toSQL example to includeZone (#351)
  • c68ac67 Update contributing.md (#310)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of mri is breaking the build 🚨


☝️ Important announcement: Greenkeeper will be saying goodbye 👋 and passing the torch to Snyk on June 3rd, 2020! Find out how to migrate to Snyk and more at greenkeeper.io


The dependency mri was updated from 1.1.4 to 1.1.5.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

mri is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v1.1.5

Patches

Chores

  • Perf: Swap forEach with for-loops: 9863715
  • Update benchmark results: 36e4a26
Commits

The new version differs by 4 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of debug is breaking the build 🚨

The dependency debug was updated from 4.0.1 to 4.1.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

debug is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for 4.1.0

Minor Changes

  • migrate Makefile to npm scripts (4236585)
  • feat: Return namespaces string when invoking disable() (7ef8b41)

Massive thank you to @mblarsen and @outsideris for knocking out two long-awaited changes.

Commits

The new version differs by 3 commits.

  • e30e8fd 4.1.0
  • 7ef8b41 feat: Return namespaces string when invoking disable()
  • 4236585 migrate Makefile to npm scripts

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of through2 is breaking the build 🚨

The devDependency through2 was updated from 2.0.4 to 2.0.5.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

through2 is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

An in-range update of luxon is breaking the build 🚨

Version 1.3.1 of luxon was just published.

Branch Build failing 🚨
Dependency luxon
Current Version 1.3.0
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

luxon is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 6 commits.

  • 5a067d7 upgrade to 1.3.1
  • b8b8a9b Implemented issue #253: Duration.toISO() doesn't include milliseconds (#284)
  • 2b65af4 Use customInspectSymbol (#281)
  • bb00371 Clarify a comment (#280)
  • b016fe7 Make DateTime#valueOf call #toMillis (#275)
  • f9cc880 upgrading prettier and reformatting

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.