growx-device-id
v1.0.1
Published
This package is designed to **construct** a DeviceID `object` for a GrowX device given 3 valid inputs of: * `owner` * `category` and * `number` where the number is greater than one thousand
Readme
GrowX DeviceID
This package is designed to construct a DeviceID object for a GrowX device given 3 valid inputs of:
ownercategoryandnumberwhere 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-numberwhere 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