Skip to content

consensusnetworks/gs1-schema

Repository files navigation

gs1-schema-dts

TypeScript types for the GS1 web vocabulary

Usage

import {Product} from "gs1-schema-dts"

const myProduct: Product = {
    "@type": "https://schema.org/Product",
    "@id": "https://example.com/product/123",
    "name": "cool product name",
    "description": "product description goes here",
}

Sample data (wip)

This package also includes a cli to assist you generate sample data.

Setup

Clone repo

git clone https://github.com/hawyar/gs1-schema-dts

Install dependencies

cd <repo> && npm i

Now you can use the cli gs1data.

Note: While in the directory you can also install the CLI globally with npm install -g gs1data.

Generate test data

Generate products (default: 10)

gs1data generate

Generate 50 products

gs1data generate --size 50

Generate 120 products with barcode images (can be used by scanner)

gs1data generate --size 120 --img

Generate 20 lots (default: 10)

gs1data generate --size 50

TODO:

  • Add tests
  • Prepare for npm
  • Generate lots (with barcode images)
  • Randomize key properties (expiry, action, owner, actions, etc)

About

TypeScript types for the GS1 web vocabulary

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published