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 🙏

© 2026 – Pkg Stats / Ryan Hefner

ember-convert-units

v1.1.0

Published

The default blueprint for ember-cli addons.

Readme

ember-convert-units

A simple Ember addon for converting between units.

Table of Contents

Installing

Run this command in your project

ember install ember-convert-units

Usage

This addon can be used in two ways

Pure Function

/*
 @param {number} quantity
 @param {string} units
 @param {string} newUnits
 @returns {number} The quantity expressed in the new units
*/

function convertUnits(quantity, units, { to: newUnits }) { ... }

Example

import { convertUnits } from 'ember-convert-units';

convertUnits(2, 'pounds', { to: 'grams' }); // 907.18474
convertUnits(5, 'mi', { to: 'km' }); // 8.04672

Template Helper

{{!--
  @param {number} quantity
  @param {string} units
  @param {string} newUnits 
  @returns {number} The quantity expressed in the new units
--}}

{{convert-units quantity units to=newUnits}}

Example

{{convert-units 2 'pounds' to='grams'}} grams
{{convert-units 5 'mi' to='km'}} km

generates the text

907.18474 grams
8.04672 km

Supported Units

For more details see register-units.js.

Length

Unit | Names ----------------------|--------------------------------------- Nanometers | nanometres, nanometers, nm Micrometers | micrometres, micrometers, μm Millimeters | millimetres, millimeters, mm Centimeters | centimetres, centimeters, cm Meters | metres, meters, m Kilometers | kilometres, kilometers, km Inches | inches, in Feet | feet, ft Yards | yards, yd Miles | miles, mi

Mass

Unit | Names ----------------------|--------------------------------------- Micrograms | micrograms, μg Milligrams | milligrams, mg Grams | grams, g Killograms | kilograms, kg Tonnes | tonnes, metric ton Tons (US) | tons, ton Ounces | ounces, oz Pounds | pounds, lb

Time

Unit | Names ----------------------|--------------------------------------- Nanoseconds | nanoseconds, ns Microseconds | microseconds, µs Milliseconds | milliseconds, ms Seconds | seconds, s Minutes | minutes, min Hours | hours, h

Temperature

Unit | Names ----------------------|--------------------------------------- degrees Fahrenheit | degrees Fahrenheit, deg F, fahrenheit degrees Celsius | degrees Celsius, deg C, celsius Kelvin | kelvin

Speed

Unit | Names ----------------------|--------------------------------------- Meters per Second | m/s Meters per Hour | m/h Kilometers per Hour | km/h, kph Feet per Second | ft/s Feet per Hour | ft/h Miles per Hour | mi/h, mph

Pressure

Unit | Names ----------------------|--------------------------------------- Nanopascals | nanopascals, npa Micropascals | micropascals, μpa Millipascals | millipascals, mpa Centipascals | centipascals, cpa Pascals | pascals, pa Kilopascals | kilopascals, kpa Nanobars | nanobars, nbar Microbars | microbars, μbar Millibars | millibars, mbar Centibars | centibars, cbar Bars | bars, bar Kilobars | kilobars, kbar Pounds per Square Inch| psi Atmosphere | atmosphere, at

Volume

Unit | Names ----------------------|--------------------------------------- Litres | litres, liters, L, l Millilitres | millilitres, milliliters, ml, mL Gallons | gallons, gal Quart | quart, qt Pint | pint, pt Fluid Ounces | fluid ounces, fl oz Acre Inch | acre inch, acre in, acre*in, acre*inch Acre Foot | acre foot, acre ft, acre*ft, acre*foot

Not currently supported

  • Area
  • Digital Storage
  • Data Transfer Rate

Feel free to contribute new units if you need them!