the-unit

1.0.1 • Public • Published

the-unit

npm PRs Welcome

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.

Install

$ yarn add the-unit
$ npm install --save-dev the-unit

Import

import unit from "the-unit";

Use

unit("16px"); // 'px'

Size

98 Bytes

Similar packages

Licence

MIT © Zander Martineau

Package Sidebar

Install

npm i the-unit

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

2.63 kB

Total Files

8

Last publish

Collaborators

  • mrmartineau