barcodes

Generates unique barcodes for shops that provide custom data.

Usage no npm install needed!

<script type="module">
  import barcodes from 'https://cdn.skypack.dev/barcodes';
</script>

README

Barcodes

Generates unique barcodes for shops that provide custom data.

It also makes sure that the barcodes are valid and pass the validation rules set by Google and other destinations for Local Inventory Data

How to use this

Add this module as a dependency

yarn add @nearst/barcodes -E -D

And use it in your code

Note if shop.customProduct is false it will return the barcode unmodified.

const { chooseBarcode } = require('@nearst/barcode');

/**
 * shop - shop object from dynamodb
 * barcode - anything that uniquely identifies that product within that shop (id, uuid, barcode, sku, gtin, ..ect)
*/

const barcode = chooseBarcode(shop, barcode)