New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ucum

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ucum

JavaScript implementation of unitsofmeasure.org (UCUM)

latest
Source
npmnpm
Version
0.0.7
Version published
Maintainers
1
Created
Source

ucum.js

JavaScript implementation of UCUM (http://unitsofmeasure.org)

Units conversion

var one_inch = ucum.convert(2.54, 'cm', '[in_i]');
console.log(one_inch)

1

Units parsing

var parsed = ucum.parse('km/h');
console.log(parsed);

{ value: 1000, units: { m: 1, h: -1 } }

Units canonicalization

var canonical = ucum.canonicalize('[in_i]/a');
console.log(canonical);

{ value: 8.048774304763354e-10, units: { m: 1, s: -1 } } 

To use in browser

Save and include a <script> tag for dist/ucum.js

To use in Node.js

npm install ucum.js

To build

$ git clone https://github.com/jmandel/ucum.js
$ cd ucum.js
$ npm install
$ make

FAQs

Package last updated on 29 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts