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 🙏

© 2026 – Pkg Stats / Ryan Hefner

trento-parking

v1.1.0

Published

A TypeScript library providing easy access to parking and bike slot availability, location, and details in Trento, Italy. Fetches data from the official Comune di Trento parking services.

Readme

Trento Parking

A TypeScript library providing easy access to parking and bike slot availability, location, and details in Trento, Italy. This library fetches real-time data from the official Comune di Trento parking services.

Features

  • Real-time parking availability data
  • Bike slot information
  • Parking location details
  • Distance calculations between parking locations
  • Filtering capabilities (by type, availability, etc.)
  • TypeScript support with full type definitions

Installation

npm install trento-parking
# or
yarn add trento-parking
# or
pnpm add trento-parking

Usage

import { ParkingDataCollection } from 'trento-parking';

// Initialize the parking collection
const parkingCollection = new ParkingDataCollection();

// Refresh the data
await parkingCollection.refresh();

// Get all parking locations
const allParkings = parkingCollection.all();

// Get a specific parking by ID
const parkingById = parkingCollection.byId(211);

// Get available parking spots
const availableParkings = parkingCollection.getAvailable();

// Get full parking locations
const fullParkings = parkingCollection.getFull();

// Get parking locations by type
const parkingsByType = parkingCollection.byType('park');

// Get distances between parking locations
const parkingWithDistances = parkingCollection.byId(211);
const distances = parkingWithDistances?.getDistancesCompleted(parkingCollection.all());

API Reference

ParkingDataCollection

The main class for interacting with parking data.

Methods

  • refresh(): Fetches the latest parking data
  • all(): Returns all parking locations
  • byId(id: number): Returns a specific parking location by ID
  • byType(type: ParkingType): Returns parking locations filtered by type
  • getAvailable(): Returns parking locations with available spots
  • getFull(): Returns parking locations that are at capacity
  • getLastRefresh(): Returns the timestamp of the last data refresh

Parking Data Model

Each parking location includes:

  • id: Unique identifier
  • name: Parking location name
  • type: Type of parking facility
  • capacity: Total number of spots
  • freeslots: Number of available spots
  • coordinates: Location coordinates
  • getDistances(): Calculates distances to other parking locations

Requirements

  • Node.js >= 18
  • TypeScript (for TypeScript projects)

Development

This project uses:

  • TypeScript for type safety
  • Vitest for testing
  • Biome for linting and formatting
  • Changesets for version management
  • tsup for building

Setup

  1. Clone the repository
  2. Install dependencies:
    pnpm install
  3. Run tests:
    pnpm test

Available Scripts

  • pnpm build: Build the library
  • pnpm test: Run tests
  • pnpm format: Format code
  • pnpm lint: Lint code
  • pnpm type-check: Check TypeScript types

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.