npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

unit-converter-pro

v1.0.1

Published

It is a npm package for converting units, including: Angle, Area, Bits, Density, ElectricCurrent, Energy, Force, Length, Mass, Power, Pressure, Speed, Temperature, Time, and Volume.

Downloads

6

Readme

Unit Converter

It is a npm package for converting units, including: Angle, Area, Bits, Density, ElectricCurrent, Energy, Force, Length, Mass, Power, Pressure, Speed, Temperature, Time, and Volume.

Install

npm install unit-converter-pro

How to use

Import

This line of code should be added at the begin of the code.

const Convert = require('unit-converter-pro');

Angle

The following code converts angle in radian to degree:

angle = new Convert.Angle();
console.log(angle.radian(Math.PI).degree());

The first one (in this case radian) is the input which recieve the value, and the second one (in this case degree) is the output.

The following units can be replaced to radian and degree in above. | Angle Unit | | --- | | arcminute | | arcsecond | | circle | | degree | | gon | | grad | | milNato | | milSovietUnion | | milSweden | | octant | | quadrant | | radian | | revolution | | sextant | | sign | | turn |


Area

area = new Convert.Area();
console.log(area.squareMeters(1).squareInches());

| Area Unit | | --- | | acres | | ares | | circularInches | | hectares | | hides | | roods | | squareCentimeters | | squareFeetUSUK | | squareFeetUSSurvey | | squareInches | | squareKilometers | | squareMeters | | squareMiles | | squareMillimeters | | squaresOfTimber | | squareRodsOrPoles | | squareYards | | townships |


Bits

bits = new Convert.Bits();
console.log(bits.kilobytes(20).bits());

| Bits Unit | | --- | | bits | | bytes | | kilobits | | kilobytes | | megabits | | megabytes | | gigabits | | gigabytes | | terabits | | terabytes | | petabits | | petabytes | | exabits | | exabytes |


Density

density = new Convert.Density();
console.log(density.kilogramsCubicMeters(1).poundsCubicInch());

| Density Unit | | --- | | grainsGallonUK | | grainsGallonUS | | gramsCubicCentimeters | | gramsLiter | | gramsMilliliters | | kilogramsCubicMeters | | kilogramsLiter | | megagramsCubicMeter | | milligramsMilliliter | | milligramsLiter | | ouncesCubicInch | | ouncesGallonUK | | ouncesGallonUS | | poundsCubicInch | | poundsCubicFoot | | poundsGallonUK | | poundsGallonUS | | slugsCubicFoot | | tonnesCubicMeter | | tonsUKCubicYard | | tonsUSCubicYard |


ElectricCurrent

electricCurrent = new Convert.ElectricCurrent();
console.log(electricCurrent.ampere(1).gilbert());

| Current Unit | | --- | | abampere | | ampere | | biot | | centiampere | | coulombSecond | | EMUOfCurrent | | ESUOfCurrent | | franklinSecond | | gaussianElectricCurrent | | gigaampere | | gilbert | | kiloampere | | megaampere | | microampere | | milliampere | | milliamp | | nanoampere | | picoampere | | siemensVolt | | statampere | | teraampere | | voltOhm | | wattVolt | | weberHenry |


Energy

energy = new Convert.Energy();
console.log(energy.joules(100).wattHours());

| Energy Unit | | --- | | btuTh | | btuMean | | caloriesIT | | caloriesTh | | caloriesMean | | calories15C | | calories20C | | caloriesFood | | centigradeHeatUnits | | dutchNaturalGas | | electronVolts | | ergs | | footPoundForce | | footPoundals | | gasolineL | | gigajoules | | horsepowerHours | | inchPoundForce | | joules | | kilocaloriesIT | | kilocaloriesTh | | kilogramForceMeters | | kilojoules | | kilowattHours | | megajoules | | newtonMeters | | petajoules | | terajoules | | therms | | wattSeconds | | wattHours |


Force

force = new Convert.Force();
console.log(force.newtons(20).poundsForce());

| Force Unit | | --- | | dynes | | kilogramsForce | | kilonewtons | | kips | | meganewtons | | newtons | | poundsForce | | poundals | | sthane | | tonnesForce | | tonsForceUK | | tonsForceUS |


Length

length = new Convert.Length();
console.log(length.inches(1000).lightYears());

| Length Unit | | --- | | angstroms | | astronomicalUnits | | barleycorns | | cables | | centimeters | | chainsSurveyors | | decimeters | | ellsUK | | emsPica | | fathoms | | feetUKUS | | feetUSSurvey | | furlongs | | hands | | hectometers | | inches | | kilometers | | lightYears | | meters | | micrometers | | mil | | milesUKUS | | milesNauticalInternational | | milesNauticalUK | | millimeters | | nanometers | | parsecs | | picometers | | scandinavianMile | | thou | | yards |


Mass

mass = new Convert.Mass();
console.log(mass.grams(200).poundsUSUK());

| Mass Unit | | --- | | caratsMetric | | cental | | decagrams | | earthMasses | | femtograms | | grains | | grams | | hectograms | | hundredweights | | kilograms | | kilotonnes | | megatonnes | | micrograms | | milligrams | | nanograms | | ouncesUSUK | | ouncesTroyPreciousMetals | | picograms | | poundsUSUK | | poundsTroyPreciousMetals | | SolarMasses | | slugsGPounds | | stones | | tonsUKLong | | tonsUSShort | | tonnesMetric |


Power

power = new Convert.Power();
console.log(power.watts(20).horsepowersInternational());

| Power Unit | | --- | | BtuHour | | BtuMinute | | BtuSecond | | caloriesThHour | | caloriesThMinute | | caloriesThSecond | | footPoundsForceMinute | | footPoundsForceSecond | | gigawatts | | horsepowersElectric | | horsepowersInternational | | horsepowersWater | | horsepowersMetric | | watts | | joulesHour | | joulesMinute | | joulesSecond | | kilocaloriesThHour | | kilocaloriesThMinute | | kilogramForceMetersHour | | kilogramForceMetersMinute | | kilowatts | | megawatts | | terawatts | | tonOfRefrigeration | | petawatts |


Pressure

pressure = new Convert.Pressure();
console.log(pressure.pascals(20).millimetersOfMercury());

| Pressure Unit | | --- | | atmospheres | | bars | | centimetersMercury | | centimetersWater | | feetOfWater | | hectopascals | | inchesOfWater | | inchesOfMercury | | kilogramForcesSqCentimeter | | kilogramForcesSqMeter | | kilonewtonsSqMeter | | kilonewtonsSqMillimeter | | kilopascals | | kipsSqInch | | meganewtonsSqMeter | | meganewtonsSqMillimeter | | megapascals | | metersOfWater | | millibars | | millimetersOfMercury | | millimetersOfWater | | newtonsSqCentimeter | | newtonsSqMeter | | newtonsSqMillimeter | | pascals | | poundsForceSqFoot | | poundsForceSqInch | | poundalsSqFoot | | tonsUKForceSqFoot | | tonsUKForceSqInch | | tonsUSForceSqFoot | | tonsUSForceSqInch | | tonnesForceSqCm | | tonnesForceSqMeter | | torr |


Speed

speed = new Convert.Speed();
console.log(speed.metersSecond(20).milesHour());

| Speed Unit | | --- | | centimetersMinute | | centimetersSecond | | feetHour | | feetMinute | | feetSecond | | inchesMinute | | inchesSecond | | kilometersHour | | kilometersSecond | | knots | | machNumber | | metersHour | | metersMinute | | metersSecond | | milesHour | | milesMinute | | milesSecond | | nauticalMilesHour | | mm24Hr | | speedOfLight | | speedOfSound | | yardsHour | | yardsMinute | | yardsSecond |


Temperature

temperature = new Convert.Temperature();
console.log(temperature.celsius(20).fahrenheit());

| Temperature Unit | | --- | | celsius | | kelvin | | fahrenheit | | rankine | | reaumur |


Time

time = new Convert.Time();
console.log(time.weeks(20).hours());

| Time Unit | | --- | | centuries | | days | | decades | | femtoseconds | | fortnights | | hours | | microseconds | | millenia | | milliseconds | | minutes | | monthsCommon | | monthsSynodic | | nanoseconds | | picoseconds | | quartersCommon | | seconds | | shakes | | weeks | | yearsCommon | | yearsAverageGregorian | | yearsJulian | | yearsLeap | | yearsTropical |


Volume

volume = new Convert.Volume();
console.log(volume.cubicInches(20).cubicCentimeters());

| Volume Unit | | --- | | acreFoot | | barrelsOil | | bushelsUK | | bushelsUS | | centiliters | | cubicCentimeters | | cubicDecimeters | | cubicDecameters | | cubicFeet | | cubicInches | | cubicKilometers | | cubicMeters | | cubicMile | | cubicMillimeters | | cubicYards | | cups | | deciliters | | dramImperial | | dramUS | | fluidOuncesImperial | | fluidOuncesUS | | gallonsImperial | | gallonsDryUS | | gallonsLiquidUS | | gillImperial | | gillUS | | kiloliters | | liters | | liters1901to1964 | | milliliters | | microliters | | nanoliters | | picoliters | | pintsImperial | | pintsDryUS | | pintsLiquidUS | | quartsImperial | | quartsDryUS | | quartsLiquidUS | | tableSpoons | | teaSpoons |