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

unit-mutation

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unit-mutation

Simple lightweight conversion library for temperature, mass, speed, and length

latest
npmnpm
Version
0.0.5
Version published
Maintainers
1
Created
Source

[MIT License]

A lightweight javascript conversion library for translating temperature, speed, mass and length values.

Note: The numbers are rounded up to the nearest 4th decimal point

Usage

Install using bower or npm:

bower install conversion.js
npm install conversion.js

Then load up a node console and try it out:


var convert = require('conversion.js');
// or load a script tag if using in the client

convert(1, 'mps').toKph();
convert(2, 'kilograms').toMetricTons()
convert(2, 'yards', { precision: 2 }).toCentimeters()

Api

// Temperature
.toCelsius
.toFahrenheit
.toKelvin

// Length
.toKilometers
.toMeters
.toCentimeters
.toMillimeters
.toMiles
.toYards
.toInches
.toFeet
.toNauticalMiles

// Mass
.toMetricTons
.toKilograms
.toGrams
.toMilligrams
.toMcgs
.toLongTons
.toShortTons
.toStones
.toPounds
.toOunces

// Speed
.toMph // Miles per hour
.toFps // Feet per second
.toMps // Meters per second
.toKph // To kilometers per hour
.toKnot // To Knot

Options

{
  precision: 4 // The decimal cutoff point at where it is rounded up
}

License

Conversion.js is freely distributable under the terms of the MIT license.

Keywords

conversion

FAQs

Package last updated on 03 May 2017

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