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

passport-parking

v1.2.0

Published

Node library for interacting with Passport's parking API.

Downloads

3

Readme

passport-parking

npm version

This library provides an unofficial wrapper around Passport's parking APIs. These APIs provide users with the ability to look up parking rules and create & pay for authorized parking sessions in many US cities.

Getting started

You must request access credentials from Passport here. Once registered, you will receive a client_id and a client_secret.

Once you have credentials, install this library into your project with:

npm i passport-parking

To make a simple zone lookup request in your application:


import passport from 'passport-parking'

const client = new passport.Client();

// client.auth() is only required prior to the first request; the access token
// will be cached for future requests.
client.auth({
    client_id: YOUR_CLIENT_ID,
    client_secret: YOUR_CLIENT_SECRET,
}).then(async () => {
    const zones = await client.get_zones({
        zone_number: 39606,
        latitude: 30.283211,
        longitude: -97.743011,
        radius: 25,
    });

    // Print all zones within 25m of the specified position with the specified zone number.
    // Zone numbers are typically listed on on-street signage.
    console.log(zones);
});

Full documentation

The following methods are available in this library; documentation is available on Passport's developer portal.

Authorize a client

Documentation: POST /oauth/token

client.auth({
    client_id: YOUR_CLIENT_ID,
    client_secret: YOUR_CLIENT_SECRET,
})

Generate an access token; this operation must be performed prior to making any other requests, and requires access credentials (username and password). Access tokens will be cached with the client once retrieved.

Retrieve zone information

Documentation: GET /zones

authorized_client.get_zones({
    zone_number: 123,
    latitude: 30.283211,
    longitude: -97.743011,
    radius: 25,
})

Retrieves a list of zones that match the provided criteria. Response matches format described in developer portal.

Retrieve rate information

Documentation: GET /rates

authorized_client.get_rates({
    zone_id: '75067b92-eee5-4816-b0e9-444ae00a8bc1',
    start_time: '2020-06-08T14:05:00Z',
    vehicle_plate: 'TEST',
    vehicle_state: 'NC',
    vehicle_country: 'US',
})

Coming soon

  • Create quotes
  • Create sessions
  • Retrieve existing sessions
  • Generate single-use payment tokens