Parses a number and unit string, and returns the unit used
Parses a number and unit string, and returns the unit used
Unlike some similar packages (see below), this package only returns the unit for a particular string; it is intentionally simple.
$ yarn add the-unit
$ npm install --save-dev the-unit
import unit from "the-unit";
unit("16px"); // 'px'
MIT © Zander Martineau