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

expo-gs1-syntax-engine

v0.1.7

Published

This project is an Expo/React Native wrapper around the GS1 Barcode Syntax Engine. It is an independent project and is not an official GS1 AISBL package.

Readme

Expo GS1 Syntax Engine

This library is an implementation of GS1 Barcode Syntax Engine as an Expo native module created using create-expo-module to be used in Expo mobile apps and in React Native mobile apps with installed Expo.

This project is an Expo/React Native wrapper around the GS1 Barcode Syntax Engine. It is an independent project and is not an official GS1 AISBL package.

Currently used GS1 Barcode Syntax Engine version: 1.4.1

About

The library uses .java wrapper from GS1 Barcode Syntax Engine that references native C code from GS1 Barcode Syntax Engine. This library is just a .kt and .ts wrapper around the .java GS1 Barcode Syntax Engine wrapper that exposes methods from GS1Encoder.java.

All GS1 Barcode Syntax Engine are exposed and ready to use and there are a few additional methods.

Installation

Expo

npx expo install expo-gs1-syntax-engine

React Native

If you are installing this in an existing React Native app, make sure to install expo in your project.

npm install expo-gs1-syntax-engine

Usage Examples

  1. First, import GS1Engine class and required types
import { GS1Engine, ProcessBarcodeResult } from 'expo-gs1-syntax-engine';
  1. Init GS1Engine class and set instance properties
// 1. Initialization function with settings
async function initGS1Encoder(): Promise<GS1Engine> {
  const gs1encoder = new GS1Engine();
  await gs1encoder.init();

  // Configuring an instance using get/set properties
  gs1encoder.permitUnknownAIs = true;
  gs1encoder.setValidationEnabled(GS1Engine.validation.RequisiteAIs, true);
  gs1encoder.includeDataTitlesInHRI = true;
  gs1encoder.permitZeroSuppressedGTINinDLuris = false;

  return gs1encoder;
}
  1. Initialize GS1Engine class in useEffect hook with cleanup function
const [encoder, setEncoder] = useState<GS1Engine | null>(null);
const [loading, setLoading] = useState<boolean>(true);
const [error, setError] = useState<string>('');

// 2. Instance Lifecycle Management
useEffect(() => {
  let activeEncoder: GS1Engine | null = null;

  async function setup() {
    try {
      setLoading(true);
      // Calling init
      activeEncoder = await initGS1Encoder();
      setEncoder(activeEncoder);
      setError('');
    } catch (err: any) {
      setError(`Error initializing the C engine: ${err.message}`);
    } finally {
      setLoading(false);
    }
  }

  setup();

  // Memory cleanup: When a component is unmounted, the native context is closed
  return () => {
    if (activeEncoder) {
      console.log('Freeing up GS1 Syntax Engine from C memory.');
      activeEncoder.close();
    }
  };
}, []);
  1. Start processing data

4.1. Using the additional method processBarcode

// gs1 datamatrix
const result3 = encoder.processBarcode(
  ']d2011231231231233310ABC123\u001D99XYZ',
  'https://mydomain.sk'
);
console.log('Processing result for gs1 datamatrix:');
console.log(result3);

4.2. Using the original methods

encoder.setScanData(']d201085800000000091126071610Lot858\u001D21Serial01');
console.log('Get HRI from direct input');
const resultDirect = encoder.getHRI();
console.log(`${resultDirect}`);
console.log('Get formated engine result data');
const complexData = encoder.getEngineResultData();
console.log(complexData);

Third-party software

This library includes portions of the GS1 Barcode Syntax Engine.

GS1 Barcode Syntax Engine Copyright (c) GS1 AISBL

Licensed under the Apache License, Version 2.0. https://www.apache.org/licenses/LICENSE-2.0

License

MIT