1.1.1 • Published 6 years ago

unit-parse v1.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Unit Parse

NPM Version Build Status

Given an value, unit-parse will be able to parse the following units:

  • rem, em, %, px
  • vh, vw, vmin, vmax
  • cm, mm, in, pt, pc, ch, ex
  • s
const parseUnit = require('unit-parse');

parseUnit('20px'); // { value: '20', unit: 'px' }
parseUnit('15%'); // { value: '15', unit: '%' }
parseUnit('-1.5s'); // { value: '-1.5', unit: 's' }

parseUnit('20px', true); // 'px'
parseUnit('15%', true); // '%'
parseUnit('-1.5s', true); // 's'

Contributing

Have a bug? Please create an issue here on GitHub that conforms with our contributing guidelines. You can also browse the Help Wanted tag in our issue tracker to find things to do.

Security

If you discover a security vulnerability within this package, please send an e-mail directly to the Centagon Developers at developers@centagon.com. All security vulnerabilities will be promptly addressed.

License

This package is available under the MIT license.

Copyright (c) 2018 Centagon, B.V.

1.1.1

6 years ago

1.1.0

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago