Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
A JavaScript library for interacting with parcel lockers offered by InPost (<https://inpost.eu>), starting with lockers in the UK.
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.
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
This package includes:
import
or require
✨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.
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.
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
.
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
).
ResponseError
s expose the full fetch
Response
- see MDN web docs for details on that interface.
FAQs
A JavaScript library for interacting with parcel lockers offered by InPost (<https://inpost.eu>), starting with lockers in the UK.
The npm package inpost receives a total of 15 weekly downloads. As such, inpost popularity was classified as not popular.
We found that inpost demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.