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

@lickd/distributions

v0.18.1

Published

Distributions parser

Readme

Distributions

Details

⚠️ Warning!

While in version 0.x there is a chance of breaking changes between minor/patch version.
Please be cautious when upgrading between versions and check for any upgrade guides.

Once a major version is released, this will no longer be the case and this library will follow Semantic Versioning.

A library for parsing and converting distribution files.

Install

$ npm install @lickd/distributions

Usage

Examples can be found in the examples folder.

Parsing

import { Distributions } from "@lickd/distributions";
import { readFileSync } from "fs";

const distributions = new Distributions();
const file = "path/to/distribution/file";

(async () => {
  const parsed = await distributions.parse(readFileSync(file).toString());

  console.log({ parsed });
})();

Converting

Direct conversion

import { Distributions, Ern411, ErnVersions } from "@lickd/distributions";
import { readFileSync } from "fs";

const distributions = new Distributions();
const file = "path/to/distribution/file";

(async () => {
  const parsed = await distributions.parse(readFileSync(file).toString(), {
    version: ErnVersions.ERN_411,
  });

  console.log({ parsed });
})();

Indirect conversion

import { Distributions, Ern411, ErnVersions } from "@lickd/distributions";
import { readFileSync } from "fs";

const distributions = new Distributions();
const file = "path/to/distribution/file";

(async () => {
  const parsed = await distributions.parse(readFileSync(file).toString());

  logger.info({ parsed });

  const converted = await distributions.parse(parsed, {
    version: ErnVersions.ERN_411,
    normalise: true,
  });

  logger.info({ converted });
})();

Logging

Enabling logging

import { Distributions } from "@lickd/distributions";

const distributions = new Distributions({
  logger: console,
});

Custom logger

import { Distributions } from "@lickd/distributions";
import { ConsoleLogger } from "@lickd/logger";

const logger = new ConsoleLogger();
const distributions = new Distributions({ logger });

Known issues

Parsing

DDEX 411+ - DisplayCredits

Due to the definition of DisplayCredits if the sequence for DisplayCreditParty and NameUsedInDisplayCredit does not have both values then the parsed result will not be correct.

<DisplayCredits>
  <DisplayCreditText>Test</DisplayCreditText>
  <DisplayCreditParty>P1</DisplayCreditParty>
  <NameUsedInDisplayCredit>Credit1</NameUsedInDisplayCredit>
  <DisplayCreditParty>P2</DisplayCreditParty>
  <NameUsedInDisplayCredit>Credit2</NameUsedInDisplayCredit>
  <DisplayCreditParty>P3</DisplayCreditParty>
  <!-- <NameUsedInDisplayCredit>P3</NameUsedInDisplayCredit> -->
  <DisplayCreditParty>P4</DisplayCreditParty>
  <NameUsedInDisplayCredit>Credit4</NameUsedInDisplayCredit>
</DisplayCredits>

Notice how P3 has the NameUsedInDisplayCredit commented out, this will result in the following:

[
  {
    "displayCreditPartyList": "P1",
    "nameUsedInDisplayCredit": "Credit1"
  },
  {
    "displayCreditPartyList": "P2",
    "nameUsedInDisplayCredit": "Credit2"
  },
  {
    "displayCreditPartyList": "P3",
    "nameUsedInDisplayCredit": "Credit4"
  },
  {
    "displayCreditPartyList": "P4"
  }
]

This is because when we convert the raw XML into raw JSON we get the following:

{
  "DisplayCreditText": ["Test"],
  "DisplayCreditParty": ["P1", "P2", "P3", "P4"],
  "NameUsedInDisplayCredit": ["Credit1", "Credit2", "Credit4"]
}

Copyright info

This scene is protected with a standard Apache 2 licence. See the terms and conditions in the LICENSE file.