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

@verisav/gs1-dpp-utils

v1.0.0

Published

Validate GTIN, GLN & GS1 Digital Link URIs for EU Digital Product Passports. Zero dependencies. Used in production at Verisav.

Readme

@verisav/gs1-dpp-utils

Validate GTIN, GLN & GS1 Digital Link URIs for EU Digital Product Passports.
Zero dependencies. Compliant with GS1 GSMP (GSCN 23-103). Aligned with EU ESPR and DPP use cases.

Used in production at Verisav for the DPP Compliance Checker, GLN Validator, and DPP QR Generator.

Install

npm install @verisav/gs1-dpp-utils

Usage

import {
  validateGTIN,
  validateGLN,
  generateGS1DigitalLinkURI,
  validateGS1DigitalLinkURI,
  extractGTINFromJSONLD,
  extractGLNFromJSONLD,
  generateGLN,
} from '@verisav/gs1-dpp-utils'

// Validate GTIN (GTIN-8, -12, -13, -14)
validateGTIN('1234567890128')   // { valid: true, type: 'GTIN-13' }
validateGTIN('123')             // { valid: false, error: '...' }

// Validate GLN (13 digits)
validateGLN('9501101530003')    // { valid: true }

// Generate GS1 Digital Link URI
generateGS1DigitalLinkURI('1234567890128')
// 'https://id.gs1.org/01/1234567890128'

generateGS1DigitalLinkURI('1234567890128', { serial: 'SN-ABC', lot: 'LOT1' })
// 'https://id.gs1.org/01/1234567890128/21/SN-ABC/10/LOT1'

// Validate a Digital Link URL
validateGS1DigitalLinkURI('https://id.gs1.org/01/1234567890128/21/SN123')
// { valid: true, isGS1: true, gtin: '1234567890128', details: { ai01: '...', ai21: '...' } }

// Extract from JSON-LD (DPP, Schema.org Product, etc.)
extractGTINFromJSONLD({ gtin: '1234567890128', name: 'Product' })  // '1234567890128'
extractGLNFromJSONLD(dppJsonLd)  // GLN from manufacturer address if present

// Generate test GLN (testing only; production GLNs are assigned by GS1)
generateGLN('950')  // e.g. '9501234567890'

API

| Function | Description | |----------|-------------| | validateGTIN(gtin) | Returns { valid, type?, error? }. Supports GTIN-8, 12, 13, 14. | | validateGLN(gln) | Returns { valid, error? }. GLN is always 13 digits. | | generateGS1DigitalLinkURI(gtin, params?) | Builds https://id.gs1.org/01/{GTIN}[/AI/value...]. Returns null if GTIN invalid. | | validateGS1DigitalLinkURI(uri) | Parses and validates a GS1 Digital Link URL. Returns { valid, isGS1, gtin?, details?, error? }. | | extractGTINFromJSONLD(obj) | Extracts GTIN from identifier (PropertyValue) or gtin. | | extractGLNFromJSONLD(obj) | Extracts GLN from identifier or manufacturer.address. | | generateGLN(prefix?) | Generates a valid 13-digit GLN (test prefix 950 by default). |

References

License

MIT