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-pl

v1.0.0

Published

InPost.pl API wrapper

Readme

inpost-pl

node.js InPost.pl API wrapper Version 1.0.0

Details: https://b2b.paczkomaty.pl/pl/e-commerce/jak-sie-zintegrowac Download API docs: https://b2b.paczkomaty.pl/file/8

Usage:

$npm install inpost-pl

then:

var InPost = require('inpost-pl');
var inPostClient = new InPost(options);
  • options.auth = {email: '[email protected]', password: 'password'} OR:
  • options.test = true (putting test credentials)
  • options.raw = true (returning XML result not JSON)

How to use InPost client?

inPostClient has 25 methods listed on index.js file. Each method has its action name which is "do" parameter (check in docs) and takes 0 to 2 arguments: (parameters, callback)

Parameters for each method are described in docs. Example call with callback:

inPostClient.findNearestMachines({postcode: '02-786'}, function(err, result){
  console.log('listMachines', err, result)
});

inPostClient.priceList(function(err, result){
  console.log('priceList', err, result)
});

email and password parameters are not required if you set options.auth or options.test

Content parameter

You can pass content parameter as object:

var content = {
  paczkomaty:[{pack: {packcode: '638111024631612017700364'}},{pack: {packcode: '638111024631612017700363'}}]
};

or XML string:

var content = '<paczkomaty>';
content += '<pack><packcode>638111024631612017700364</packcode></pack>';
content += '<pack><packcode>638111024631612017700363</packcode></pack>';
content += '</paczkomaty>';
Handling files

Each method also returning its request, so you can pipe it.

var stream = inPostClient.pdf.getConfimPrintOut({content: content});
stream
  .on('error', function(err){
    console.error('getConfimPrintOut', err)
  })
  .on('response', function(response){
    var isPdf = response.caseless.dict['content-type'] == 'application/pdf';
    if(isPdf) {
      stream.pipe(fs.createWriteStream('printout_1.pdf'))
    } else {
      InPost.parseBody(response, function(body){
        console.log('getConfimPrintOut response body', body)
      })
    }
  });
InPost methods:
  • InPost.parseBody(response, cb) - parsing raw response body
  • InPost.setDefault(options) - setting app scope InPost.client and returning it.
var inPostClient = InPost.setDefault(options);
console.log(inPostClient instanceof InPost)
console.log(inPostClient == InPost.client)
//true
//true

Check index.js to get client's method names

Check test.js