1.0.1 • Published 6 years ago
growx-device-id v1.0.1
GrowX DeviceID
This package is designed to construct a DeviceID object
for a GrowX device given 3 valid inputs of:
owner
category
andnumber
where the number is greater than one thousand
Sample usage:
const devId = new DeviceID('dS', 'CaR', 4031);
/*
{
owner: 'ds',
category: 'car',
number: 4031
}
*/
This package also contains a static
method for parsing a string into a DeviceID object
given a valid string input of:
owner-category-number
where the number is greater than one thousand
Sample usage:
const devId = DeviceID.parse('dS-CaR-4031');
/*
{
owner: 'ds',
category: 'car',
number: 4031
}
*/
Prereqs
- yarn
Setup
yarn install
Development
This package is designed to be included in a parent project, imported and run from the parent source code.
Testing
yarn test
Builds
# build for production with minification
yarn run build