Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

get-unit

arthurvr28MIT2.0.1

Naive way to check what the unit of a passed quantity is

amount, unit, quantity, parser, measurements

readme

get-unit Build Status

Naive way to check what the unit of a given quantity is

Installation

$ npm install get-unit --save

Usage

var getUnit = require('get-unit');

getUnit('5 mm');
//=> 'mm'

getUnit('1.004 A');
//=> 'A'

getUnit('1,4km');
//=> 'km'

getUnit('.4V');
//=> 'V'

getUnit('4');
//=> null

License

MIT © Arthur Verschaeve