Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@ombori/epc-ean

sergiss549MIT4.1.34TypeScript support: included

EPC Tag Data Standard encoding and decoding library, written in javascript

EPC, RFID, TAG, GS1, Decode, Encode, Library, Barcode, Sgtin96, Sgtin198, Sgln96, Sgln195, Sscc96, Grai96, Grai170, Gid96, Giai96, Giai202, Gsrn96, Cpi96, Gdti96, Gdti174, Sgcn96

readme

epc-tds

EPC Tag Data Standard encoding and decoding library, written in javascript (Node.JS and Frontend)

Simple, very fast and easy to use ;)

NPM Version

Usage

Automatic decoding of any standard (SGTIN-96, SGTIN-198, SSCC-96, SGLN-96, GID, GRAI, GSRN, ...)


const epcTds = require('epc-tds');

var epc = epcTds.valueOf("3074257BF7194E4000001A85"); // SGTIN-96
console.log("Id URI : " + epc.toIdURI());
console.log("Tag URI: " + epc.toTagURI());
console.log("Barcode: " + epc.toBarcode()); // sgtin
console.log("Serial : " + epc.getSerial());

epc = epcTds.valueOf("3178E61C883950F59A000000"); // SSCC-96
console.log("Id URI : " + epc.toIdURI());
console.log("Tag URI: " + epc.toTagURI());
console.log("Barcode: " + epc.toBarcode()); // sscc
console.log("Serial : " + epc.getSerialReference());

epc = epcTds.valueOf("377A6BB0C1BDA6D9B664D1AB266D1AB266D1AB266D00"); // GRAI-170
console.log("Id URI : " + epc.toIdURI());
console.log("Tag URI: " + epc.toTagURI());
console.log("Barcode: " + epc.toBarcode()); // grai
console.log("Serial : " + epc.getSerial());

Decode Hex EPC


const epcTds = require('epc-tds');

// Decode from Hex EPC
let epc = tds.valueOf("3074257BF7194E4000001A85"); // sgtin-96

// Acces to epc properties
console.log("Type: "          + epc.getType()); // TDS ID
console.log("Filter: "        + epc.getFilter()); // filter index
console.log("Partition: "     + epc.getPartition()); // partition index
console.log("CompanyPrefix: " + epc.getCompanyPrefix());
console.log("ItemReference: " + epc.getItemReference());
console.log("GTIN(EAN): "     + epc.getGtin()); // ean
console.log("HexEPC: "        + epc.toHexString()); // HEX EPC
console.log("Tag URI: "       + epc.toTagURI());

// Decode from Hex Tag URI
epc = epcTds.fromTagURI('urn:epc:tag:sgtin-96:3.0614141.812345.6789');
console.log("HexEPC: "  + epc.toHexString()); // HEX EPC
console.log("Tag URI: " + epc.toTagURI());

Encode Hex EPC


const epcTds = require('epc-tds');

// e.g. 1: EAN + Serial
let epc1 = new epcTds.Sgtin96().setFilter(3)
                            .setPartition(5)
                            .setGtin("00001234523457")
                            .setSerial(1823342345);

console.log("HexEPC: "  + epc1.toHexString()); // HEX EPC
console.log("Tag URI: " + epc1.toTagURI());

// e.g. 2: (companyPrefix + ItemReference) + Serial
let epc2 = new epcTds.Sgtin96().setFilter(3)
                            .setPartition(5)
                            .setCompanyPrefix(78952)
                            .setItemReference(44235)
                            .setSerial(1010011010);

console.log("HexEPC: "  + epc2.toHexString()); // HEX EPC
console.log("Tag URI: " + epc2.toTagURI());
<Note>

Note: This is a summary of how the library works, check the source code for more features.

</Note>

Frontend version

<!DOCTYPE html>
<html lang="en">
    <head>
        <script src="/bundle/epc-tds.min.js"></script>
    </head>
    <body>
        <script>
            const tds = require('epc-tds')
            let epc = tds.valueOf("3074257BF7194E4000001A85");
            alert(epc.toTagURI());
        </script> 
    </body>
</html>

www.sergiosoriano.com

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

4.1.34 (2025-02-26)

Bug Fixes

4.1.33 (2025-02-26)

Bug Fixes

4.1.32 (2025-02-17)

Bug Fixes

  • do not upload new browser device / screen (a2c9e43)

4.1.31 (2025-01-17)

Note: Version bump only for package @ombori/epc-ean

4.1.30 (2025-01-14)

Note: Version bump only for package @ombori/epc-ean

4.1.29 (2025-01-14)

Note: Version bump only for package @ombori/epc-ean

4.1.28 (2024-12-19)

Note: Version bump only for package @ombori/epc-ean

4.1.27 (2024-10-03)

Note: Version bump only for package @ombori/epc-ean

4.1.26 (2024-10-03)

Note: Version bump only for package @ombori/epc-ean

4.1.25 (2024-09-06)

Note: Version bump only for package @ombori/epc-ean

4.1.24 (2024-09-06)

Note: Version bump only for package @ombori/epc-ean

4.1.22 (2024-08-25)

Bug Fixes

4.1.21 (2024-08-25)

Bug Fixes

  • attempt at new caching at app level (7a34054)

4.1.20 (2024-08-25)

Bug Fixes

4.1.19 (2024-08-25)

Bug Fixes

4.1.18 (2024-08-25)

Bug Fixes

4.1.17 (2024-08-25)

Bug Fixes

  • attempt at unfiltered settings 3 (a76bfc3)

4.1.16 (2024-08-25)

Bug Fixes

  • attempt at unfiltered settings 2 (d073d75)

4.1.15 (2024-08-25)

Bug Fixes

  • attempt at unfiltered settings (843a0e1)

4.1.14 (2024-08-25)

Bug Fixes

4.1.13 (2024-08-25)

Bug Fixes

4.1.12 (2024-08-25)

Bug Fixes

4.1.11 (2024-08-25)

Bug Fixes

4.1.10 (2024-08-25)

Bug Fixes

  • better total progress 2 (284d21e)

4.1.9 (2024-08-25)

Bug Fixes

4.1.8 (2024-08-25)

Bug Fixes

4.1.7 (2024-08-25)

Bug Fixes

4.1.6 (2024-08-25)

Bug Fixes

4.1.5 (2024-08-25)

Bug Fixes

4.1.4 (2024-08-25)

Bug Fixes

  • handle invalid manifest response (7b61a7d)

4.1.3 (2024-08-25)

Bug Fixes

  • fuckup, need to keep container for the schema (4f31201)

4.1.2 (2024-08-25)

Bug Fixes

4.1.1 (2024-08-25)

Bug Fixes

  • settings read from right localstorage (9dcf45c)

4.1.0 (2024-08-25)

Features

4.0.6 (2024-08-25)

Bug Fixes

4.0.5 (2024-08-25)

Bug Fixes

4.0.4 (2024-08-25)

Bug Fixes

4.0.3 (2024-08-24)

Bug Fixes

4.0.2 (2024-08-24)

Bug Fixes

4.0.1 (2024-08-24)

Bug Fixes

3.92.13 (2024-05-30)

Bug Fixes

  • refactored ga-messaging (0f1b527)

3.92.12 (2024-05-29)

Note: Version bump only for package @ombori/epc-ean

3.92.11 (2024-05-26)

Bug Fixes

3.92.10 (2024-05-25)

Bug Fixes

3.92.9 (2024-05-25)

Note: Version bump only for package @ombori/epc-ean

3.92.8 (2024-05-24)

Note: Version bump only for package @ombori/epc-ean

3.92.7 (2024-05-24)

Bug Fixes

3.92.6 (2024-05-24)

Note: Version bump only for package @ombori/epc-ean

3.92.5 (2024-05-20)

Bug Fixes

  • exit if it can not connect to phyedged timeout 2 (ad402af)

3.92.4 (2024-05-20)

Bug Fixes

  • exit if it can not connect to phyedged timeout (c45ca4a)

3.92.3 (2024-05-20)

Bug Fixes

  • throw an error it connection fails (5f61fc8)

3.92.2 (2024-05-16)

Note: Version bump only for package @ombori/epc-ean

3.92.1 (2024-05-16)

Note: Version bump only for package @ombori/epc-ean

3.92.0 (2024-05-15)

Features

  • data matrix data source type (bc47310)

3.91.13 (2024-05-14)

Note: Version bump only for package @ombori/epc-ean

3.91.12 (2024-05-14)

Note: Version bump only for package @ombori/epc-ean

3.91.11 (2024-05-14)

Bug Fixes

  • new docker buildx local tag 2 (4b63c84)

3.91.10 (2024-05-14)

Bug Fixes

  • new docker buildx local tag (084f1a9)

3.91.9 (2024-05-12)

Note: Version bump only for package @ombori/epc-ean

3.91.8 (2024-05-12)

Note: Version bump only for package @ombori/epc-ean

3.91.7 (2024-05-11)

Note: Version bump only for package @ombori/epc-ean

3.91.6 (2024-05-03)

Note: Version bump only for package @ombori/epc-ean

3.91.5 (2024-04-16)

Note: Version bump only for package @ombori/epc-ean

3.91.4 (2024-04-15)

Note: Version bump only for package @ombori/epc-ean

3.91.3 (2024-04-15)

Note: Version bump only for package @ombori/epc-ean

3.91.2 (2024-04-15)

Reverts

3.91.1 (2024-04-08)

Note: Version bump only for package @ombori/epc-ean

3.91.0 (2024-04-08)

Features

3.90.12 (2024-03-14)

Note: Version bump only for package @ombori/epc-ean

3.90.11 (2024-03-14)

Note: Version bump only for package @ombori/epc-ean

3.90.10 (2024-03-11)

Note: Version bump only for package @ombori/epc-ean

3.90.9 (2024-03-11)

Note: Version bump only for package @ombori/epc-ean

3.90.8 (2024-03-11)

Note: Version bump only for package @ombori/epc-ean

3.90.7 (2024-03-11)

Note: Version bump only for package @ombori/epc-ean

3.90.6 (2024-03-08)

Note: Version bump only for package @ombori/epc-ean

3.90.5 (2024-03-07)

Note: Version bump only for package @ombori/epc-ean

3.90.3 (2024-03-07)

Note: Version bump only for package @ombori/epc-ean

3.90.2 (2024-03-07)

Bug Fixes

3.90.1 (2024-03-06)

Note: Version bump only for package @ombori/epc-ean

3.42.0 (2023-05-08)

Note: Version bump only for package @ombori/epc-ean

3.41.1 (2023-05-08)

Bug Fixes

  • support for environment not supporting BigInt literals (b428083)

3.33.2 (2023-04-19)

Bug Fixes

3.33.1 (2023-04-19)

Bug Fixes

3.33.0 (2023-04-19)

Features

3.32.0 (2023-04-19)

Features