An open API service indexing awesome lists of open source software.

https://github.com/schie/epc

parsing and creating EPCs
https://github.com/schie/epc

epc rfid typescript

Last synced: 5 months ago
JSON representation

parsing and creating EPCs

Awesome Lists containing this project

README

          

# @schie/epc

[![npm version](https://badge.fury.io/js/@schie%2Fepc.svg)](https://www.npmjs.com/package/@schie/epc)
[![CI](https://github.com/schie/epc/actions/workflows/ci.yml/badge.svg)](https://github.com/schie/epc/actions/workflows/ci.yml)
[![CodeQL](https://github.com/schie/epc/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/schie/epc/actions/workflows/github-code-scanning/codeql)
[![Super-Linter](https://github.com/schie/epc/actions/workflows/super-linter.yml/badge.svg)](https://github.com/schie/epc/actions/workflows/super-linter.yml)
[![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=flat&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
[![codecov](https://codecov.io/gh/schie/epc/branch/main/graph/badge.svg)](https://codecov.io/gh/schie/epc)
[![code style: prettier][prettier-badge]][prettier]
[![Commitizen friendly][commitizen-badge]][commitizen]

A modern, type-safe TypeScript library for generating and parsing **EPC (Electronic Product Code)** identifiers used in UHF RFID tags.

> **โš ๏ธ Early Development Notice**
> This library is under active early development. Until v1.0.0 is released, consider all releases potentially breaking. The API may change significantly between versions as we refine the design based on user feedback and real-world usage patterns.

## โœจ Features

- ๐Ÿงฉ **EPC Generation** - Create EPCs from GS1 components
- ๐Ÿ” **Parsing** - Decode EPC hex into structured data
- ๐Ÿ›ก๏ธ **Type Safe** - Full TypeScript support with comprehensive types
- ๐Ÿ“ฆ **Zero Dependencies** - Lightweight and fast
- ๐Ÿงช **Ready for Testing** - Built for easy unit test coverage

## ๐Ÿš€ Quick Start

### Installation

```bash
npm install @schie/epc
```

### Basic Usage

```typescript
import { encodeSgtin96, parseEpc } from '@schie/epc';

const epc = encodeSgtin96({
companyPrefix: '0614141',
itemReference: '812345',
serial: 6789,
filter: 3,
});

console.log(epc.hex);
console.log(epc.uri);

const parsed = parseEpc(epc.hex);
console.log(parsed.scheme); // sgtin-96
```

## ๐Ÿ“ฆ Package Information

- **ES Modules**: Full ESM support with tree shaking
- **CommonJS**: CJS builds included for compatibility
- **TypeScript**: Complete type definitions included
- **Node.js**: Requires Node.js 20+

## ๐Ÿงพ Supported Schemes

- SGTIN-96
- GID-96

## ๐Ÿค Contributing

Contributions are welcome! This project uses:

- **TypeScript** for type safety
- **Jest** for testing
- **ESLint + Prettier** for code quality
- **Commitizen** for conventional commits

```bash
# Install dependencies
npm install

# Run tests
npm test

# Build
npm run build

# Lint
npm run lint
```

## ๐Ÿ“„ License

MIT License - see [LICENSE](LICENSE) file for details.

## ๐Ÿ”— Links

- [NPM Package](https://www.npmjs.com/package/@schie/epc)
- [Translation Steps](translation-steps.md)
- [GitHub Repository](https://github.com/schie/epc)

---

Made with โค๏ธ by [@schie](https://github.com/schie)

[prettier-badge]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg
[prettier]: https://github.com/prettier/prettier
[commitizen-badge]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg
[commitizen]: http://commitizen.github.io/cz-cli/