Socket
Socket
Sign inDemoInstall

convert-units

Package Overview
Dependencies
Maintainers
2
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

convert-units

Convert between quantities in different units


Version published
Weekly downloads
167K
decreased by-2.45%
Maintainers
2
Weekly downloads
 
Created

What is convert-units?

The convert-units npm package is a utility for converting between various units of measurement. It supports a wide range of units across different categories such as length, mass, volume, temperature, and more.

What are convert-units's main functionalities?

Length Conversion

This feature allows you to convert between different units of length. In the code sample, 1 meter is converted to feet.

const convert = require('convert-units');
const result = convert(1).from('m').to('ft');
console.log(result); // 3.28084

Mass Conversion

This feature allows you to convert between different units of mass. In the code sample, 1 kilogram is converted to pounds.

const convert = require('convert-units');
const result = convert(1).from('kg').to('lb');
console.log(result); // 2.20462

Volume Conversion

This feature allows you to convert between different units of volume. In the code sample, 1 liter is converted to fluid ounces.

const convert = require('convert-units');
const result = convert(1).from('l').to('fl-oz');
console.log(result); // 33.814

Temperature Conversion

This feature allows you to convert between different units of temperature. In the code sample, 100 degrees Celsius is converted to Fahrenheit.

const convert = require('convert-units');
const result = convert(100).from('C').to('F');
console.log(result); // 212

Speed Conversion

This feature allows you to convert between different units of speed. In the code sample, 60 kilometers per hour is converted to miles per hour.

const convert = require('convert-units');
const result = convert(60).from('km/h').to('mph');
console.log(result); // 37.2823

Other packages similar to convert-units

Keywords

FAQs

Package last updated on 12 Jan 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc