Skip to content

Latest commit

 

History

History
71 lines (47 loc) · 1.19 KB

README.md

File metadata and controls

71 lines (47 loc) · 1.19 KB

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)