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

un-ece-recommendation

v0.1.1

Published

[![npm version](https://badge.fury.io/js/un-ece-recommendation.svg)](https://badge.fury.io/js/un-ece-recommendation) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Readme

UN/ECE Recommendation N°20 and N°21 code lists for JavaScript / TypeScript

npm version License: MIT

JavaScript package for the United Nations Economic Commission for Europe (UN/ECE) Recommendation N°20 and N°21 code lists.

About UN/ECE Recommendations

The United Nations Economic Commission for Europe (UN/ECE) develops a series of trade facilitation recommendations to simplify and harmonize international trade procedures. Among these are:

  • Recommendation N°20 (Rec. 20): Codes for Units of Measure Used in International Trade.
  • Recommendation N°21 (Rec. 21): Codes for Passengers, Types of Cargo, Packages and Packaging Materials.

These code lists are essential in e-invoicing standards like EN16931, ZUGFeRD, and XRechnung to ensure a common understanding of units of measure and package types. This package provides the official UN/ECE code lists in a developer-friendly format for use in JavaScript and TypeScript applications.

RechnungsAPI

If you are looking for an API solution to generate German e-invoice documents, consider checking out RechnungsAPI, without which this package would not exist.

Installation

Install the package using your favorite package manager:

npm install un-ece-recommendation

or

yarn add un-ece-recommendation

Usage

You have the flexibility to either import the entire collection of code lists or import a specific code list individually, which can help in reducing the final bundle size of your application.

Importing All Code Lists

All available code lists are exported as named objects from the main package entry point.

import { REC_20_2, REC_21_3 } from 'un-ece-recommendation';

console.log('Recommendation N°20 Codes:', REC_20_2);
// [
//   { code: "05", name: "lift" },
//   { code: "06", name: "small spray" },
//   { code: "08", name: "heat lot" },
//   ...
// ]

console.log('Recommendation N°21 Codes:', REC_21_3);
// [
//   { code: "X1A", name: "Drum, steel" },
//   { code: "X1B", name: "Drum, aluminium" },
//   { code: "X1D", name: "Drum, plywood" },
//   ...
// ]

Importing a Specific Code List

For a more optimized approach, you can deep-import a single code list directly.

import { REC_20_1 } from 'un-ece-recommendation/20/1';

console.log(REC_20_1);
// [
//   { code: "10", name: "group" },
//   { code: "11", name: "outfit" },
//   { code: "13", name: "ration" },
//   ...
// ]

Data Structure

Each code list is provided as an array of objects, where each object adheres to the CodeListEntry type.

export interface CodeListEntry {
	code: string;
	name?: string;
	description?: string;
}

export type CodeList = CodeListEntry[];