Licence
UNLICENSED
Version
0.0.1
Deps
1
Vulns
0
Weekly
0
carrefour
Use the carrefour library to generate the Product Variant options for the Material platform based on the values of the different variant groups.
Installation and Usage
Using npm:
$ {sudo -H} npm i -g npm
$ npm i --save @material-dev/carrefour
In Node.js:
const carrefour = require('carrefour');
const variantOptions = carrefour.buildVariants(['Red', 'Blue'], ['S', 'M', 'L']);
/*
[
{ variants: ['Red', 'S'], isShopperVisible: true },
{ variants: ['Red', 'M'], isShopperVisible: true },
{ variants: ['Red', 'L'], isShopperVisible: true },
{ variants: ['Blue', 'S'], isShopperVisible: true },
{ variants: ['Blue', 'S'], isShopperVisible: true },
{ variants: ['Blue', 'S'], isShopperVisible: true },
]
*/
To run the code locally:
Confirm that node v6 and git are installed
Clone the repo
git clone git@github.com:MaterialDev/carrefour.git
- Install dependencies
npm install
- Run the tests
npm test