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

node-go2ubl

v1.3.1

Published

#### Node library to use the go2UBL API. Allows you to:

Downloads

87

Readme

node-go2UBL

Node library to use the go2UBL API. Allows you to:

  • Send purchase and sale invoices and logistic documents to go2UBL for conversion to UBL format
  • Track a sent document's status during its conversion lifecycle
  • Retrieve all document metadata created during the conversion lifecycle

As well as:

  • Add companies to your account
  • Enable companies in your account
  • Disable companies in your account
  • Get a company's whitelist with accepted email addresses
  • Add an email address to a company's whitelist
  • Remove an email address from a company's whitelist

Please note

This library is not in any way associated with go2UBL. Use at your own risk. Please see the license at the bottom of this README.

How to install

npm install node-go2ubl --save

Before you can call the go2UBL API

You will need to aquire your API credentials from go2UBL. You can do so by contacting them using the following URL:

https://www.go2ubl.nl/api

After this you can initialize the library as follows:

const go2UBL = require('node-go2ubl');

go2UBL.initialize({
    identifier: 'Get these from go2UBL...',
    code: 'Get these from go2UBL...',
    token: 'Get these from go2UBL...',
});

Sending and then tracking a document during its conversion lifecycle

// ... after initializing your library (see above) ...

await go2UBL.uploadDocument({
    type: 'purchase', // purchase, sale or logistic
    includeLines: true, // This is only valid for purchase documents
    externalId, // Your own tracking identity
    filename: 'document.pdf',
    chamberOfCommerceId: KVK,
    document: fs.readFileSync('document.pdf').toJSON().data
});

const update = async () => {
    const documentResponse = await go2UBL.getDocumentsWithChangedStatus();
    if (documentResponse.Success) {
        for (let document of documentResponse.Results) {
            const response = await go2UBL.getDocument(document.DocumentGuid);
            console.log(response.Result);
        }
    }

    const documentsStillToBeProcessed = await go2UBL.getDocumentsStillToBeProcessed();
    console.log(`${documentsStillToBeProcessed.Results.length} are waiting to be processed.`);
    const documentsStillToBeDelivered = await go2UBL.getDocumentsStillToBeDelivered();
    console.log(`${documentsStillToBeDelivered.Results.length} are being delivered.`);
    const processedDocuments = await go2UBL.getReadyDocuments();
    console.log(`${processedDocuments.Results.length} are ready.`);
    const declinedDocuments = await go2UBL.getFailedDocuments();
    console.log(`${declinedDocuments.Results.length} have failed.`);

    setTimeout(update, 5000);
}

setTimeout(update, 5000);

Adding and modifying companies

const chamberOfCommerce = '12345678';
console.log(await go2UBL.addCompany(chamberOfCommerce, [], '[email protected]'));
console.log(await go2UBL.disableCompany(chamberOfCommerce));
console.log(await go2UBL.enableCompany(chamberOfCommerce));
console.log(await go2UBL.addEmailToCompanyWhitelist(chamberOfCommerce, '[email protected]'));
console.log(await go2UBL.getCompany(chamberOfCommerce));
console.log(await go2UBL.deleteEmailFromCompanyWhitelist(chamberOfCommerce, '[email protected]'));

LICENSE

MIT License

Copyright (c) 2023 Jaapjan Tinbergen

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.