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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@infa-toolkit/route-tracking

v1.0.7

Published

Route Tracking gathers GPS information (usually for vehicles) while running in the background to provide a full sequence of the driven route over several hours.

Downloads

28

Readme

infa-route-tracking

Route Tracking gathers GPS information (usually for vehicles) while running in the background to provide a full sequence of the driven route over several hours.

Install

npm install @infa-toolkit/route-tracking
npx cap sync

API

echo(...)

echo(options: { value: string; }) => Promise<{ value: string; }>

Returns the given value after showing it in the native logging prompt (e.g. LogCat)<br> <i>This is a default plugin method.</i>

| Param | Type | | ------------- | ------------------------------- | | options | { value: string; } |

Returns: Promise<{ value: string; }>


checkPermissions()

checkPermissions() => Promise<PermissionStatus>

Returns the permission status required by the plugin.<br> <i>This is a standard plugin method.</i>

Returns: Promise<PermissionStatus>


requestPermissions()

requestPermissions() => Promise<PermissionStatus>

Requests the permissions required by the plugin and returns the status.<br> <i>This is a standard plugin method.</i>

Returns: Promise<PermissionStatus>


addListener(string, ...)

addListener(eventName: string, listenerFunc: ListenerCallback) => Promise<PluginListenerHandle> & PluginListenerHandle

Add a callback function to react on a native event, even while the hosting application is not showing in the foreground.<br> <i>This is a standard plugin method.</i>

| Param | Type | | ------------------ | ------------------------------------------------------------- | | eventName | string | | listenerFunc | ListenerCallback |

Returns: Promise<PluginListenerHandle> & PluginListenerHandle


getStatus()

getStatus() => Promise<RouteTrackingServiceStatusResult>

Returns the status of the service.<br>

Returns: Promise<RouteTrackingServiceStatusResult>


start(...)

start(config: RouteTrackingProviderConfiguration) => Promise<void>

Starts the native route tracking daemon.<br> Consider to clear the native storage immediately after starting the tracking to make sure, that the records will not merge with previous tracks.

| Param | Type | | ------------ | ------------------------------------------------------------------------------------------------- | | config | RouteTrackingProviderConfiguration |


restore()

restore() => Promise<void>

Attempts to restore to a running native route tracking daemon.<br> Use this method if your app has crashed during a running session to restore the broadcast receivers, which notify the listeners on each event.


stop()

stop() => Promise<void>

Stops the native route tracking daemon.<br> Consider to continue with <code>fetch()</code> and <code>clear()</code> after stopping was successful to make sure, that all remaining locations will be transferred to the host.


fetch(...)

fetch(limit?: number | undefined) => Promise<RouteTrackingFetchResult>

Requests and returns cached locations from the native storage.<br> The locations will be returned beginning with the oldest entry up to the newest one, ordered by <code>RouteTrackingGeolocation.timestamp</code> ascending.<br> Make sure to delete the locations after successfully storing them to your local host-application by subsequently calling <code>clear()</code>.

| Param | Type | Description | | ----------- | ------------------- | ---------------------------------------------------------------------------------------------- | | limit | number | Maximum number of returned locations at once. If unset, the method returns all stored records. |

Returns: Promise<RouteTrackingFetchResult>


clear(...)

clear(time?: number | undefined) => Promise<void>

Removes all locations from the native storage. If the timestamp is set, only locations with a timestamp lower or equal to the given timestamp will be considered for removal.<br> <i>Use the time of the latest returned location when chaining clear with fetch.</i>

| Param | Type | | ---------- | ------------------- | | time | number |


Interfaces

PermissionStatus

| Prop | Type | Description | | -------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------ | | location | PermissionState | The naming must match the permission alias set up in the plugin´s annotations. |

PluginListenerHandle

| Prop | Type | | ------------ | ----------------------------------------- | | remove | () => Promise<void> |

RouteTrackingServiceStatusResult

| Prop | Type | | ---------- | --------------------------------------------------------------------------------- | | code | RouteTrackingServiceStatus |

RouteTrackingProviderConfiguration

| Prop | Type | Description | Default | | -------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | ----------------- | | interval | number | Set the desired interval of a location request, in milliseconds. | | | priority | RouteTrackingPriority | Set the quality of the request. - HIGH_ACCURACY = 100 - BALANCED_POWER_ACCURACY = 102 - LOW_POWER = 104 - NO_POWER = 105 | 100 | | smallestDisplacement | number | Set the minimum displacement between location updates in meters. If unset, this criteria is disabled. | null |

RouteTrackingFetchResult

| Prop | Type | | ----------- | --------------------------------------- | | items | RouteTrackingGeolocation[] |

RouteTrackingGeolocation

| Prop | Type | Description | | ---------------------- | ------------------- | ---------------------------------------------------------------------------------------- | | latitude | number | Coordinate latitude value between -90° and 90° | | longitude | number | Coordinate longitude value between -180° and 180° | | altitude | number | Coordinate altitude value in meters above sea level | | time | number | Unix epoch time of this location based on milliseconds since 00:00:00 January 1 1970 UTC | | speed | number | Approximate speed in meters per second | | bearing | number | Approximate bearing in degrees from 0° (North) over 90° (East) clockwise | | accuracy | number | Horizontal coordinate accuracy in meters from the real location | | speedAccuracy | number | Speed accuracy in meters per second from the real speed | | bearingAccuracy | number | Bearing accuracy in degrees from the real bearing | | verticalAccuracy | number | Vertical coordinate accuracy in meters below / above the real altitude |

Type Aliases

PermissionState

'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'

ListenerCallback

(err: any, ...args: any[]): void

Enums

RouteTrackingServiceStatus

| Members | Value | | -------------- | -------------- | | INACTIVE | 0 | | ACTIVE | 1 |

RouteTrackingPriority

| Members | Value | | ----------------------------- | ---------------- | | HIGH_ACCURACY | 100 | | BALANCED_POWER_ACCURACY | 102 | | LOW_POWER | 104 | | NO_POWER | 105 |