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 🙏

© 2025 – Pkg Stats / Ryan Hefner

inpost

v1.0.1

Published

A JavaScript library for interacting with parcel lockers offered by InPost (<https://inpost.eu>), starting with lockers in the UK.

Readme

InPost

This JavaScript package allows you to interact with InPost parcel lockers in the UK using InPost's undocumented APIs.

With this client library, you can access the name, address, coordinates and current locker availability at InPost parcel lockers near a given UK postcode or set of latitude and longitude coordinates.

Installation

Install the inpost package from the npm package registry:

# If you're using npm
npm install --save inpost

# If you're using Yarn
yarn add inpost

Usage

This package includes:

  • support for ESM and CommonJS modules - so no matter how your project is set up, you should be able to use it with either import or require
  • Typescript types for a 10/10 developer experience 🌟

Finding InPost locations near to a given UK postcode

To find InPost locations near to a given UK postcode, use the findLocationsByPostcode function:

import { findLocationsByPostcode } from 'inpost';

const locations = await findLocationsByPostcode('SW1A 1AA');

for (const location of locations) {
  console.log(`Found nearby location "${location.name}" (${location.id})`);
  console.log(`Current availability: S: ${location.smallLockerAvailability}, M: ${location.mediumLockerAvailability}, L: ${location.largeLockerAvailability}`);
}

See the ListedLocation type for details on the data available for each location.

Each location includes an id which can be used to get locker availability for that location and to fetch the location by its ID in the future.

Finding InPost locations near to a set of latitude and longitude coordinates

To find InPost locations near to a specific set of latitude and longitude coordinates, use the findLocationsByCoordinates function:

import { findLocationsByCoordinates } from 'inpost';

const locations = await findLocationsByCoordinates(51.463, -0.0987);

for (const location of locations) {
  console.log(`Found nearby location "${location.name}" (${location.id})`);
  console.log(`Current availability: S: ${location.smallLockerAvailability}, M: ${location.mediumLockerAvailability}, L: ${location.largeLockerAvailability}`);
}

See the ListedLocation type for details on the data available for each location.

Each location includes an id which can be used to get locker availability for that location and to fetch the location by its ID in the future.

Fetching a location by its ID

To fetch an InPost location by its ID - returned by findLocationsByPostcode or findLocationsByCoordinates - use the getLocation function:

import { getLocation } from 'inpost';

const location = await getLocation('UK00000756');

console.log(`Loaded location "${location.name}"`);
console.log(`Current availability: S: ${location.smallLockerAvailability}, M: ${location.mediumLockerAvailability}, L: ${location.largeLockerAvailability}`);

See the Location type for details on the data available for a location. Note that the lastUpdatedAt data, indicating when locker availability was last updated, is not available in this type, and can only be accessed through findLocationsByPostcode and findLocationsByCoordinates.

Error handling

If InPost returns an error, then a ResponseError will be thrown.

The error's message will include the error message returned by InPost - or if no error message can be found, then it'll use something fairly generic (Got status code 404, expected 200).

ResponseErrors expose the full fetch Response - see MDN web docs for details on that interface.