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

measurementjs

v0.1.1-a

Published

Nice unit-of-measure conversion.

Downloads

14

Readme

MeasurementJs

Code Climate Build Status devDependency Status

Nice unit of measure conversion, featuring:

  • Simplicity: an easy to-use, Behaviour driven API
  • Sophistication: Coverage Status full test coverage from project day one
  • Quality: aiming at high performance whilst maintaining a fair trade-off between accuracy
  • Adaptability: Easy to extend for new measurement types (incl. i18n tables)
measurement('Temperature').convert(20)
    .from(measurement.Unit.Temperature.CELSIUS)
    .to(measurement.Unit.Temperature.FAHRENHEIT);        // returns 68

measurement('Distance').convert(1)
    .from(measurement.Unit.Distance.KILOMETRE)
    .to(measurement.Unit.Distance.METRE);                // returns 1000
    
measurement('Speed').convert(10)
    .from(measurement.Unit.Speed.KILOMETRE_PER_HOUR)
    .to(measurement.Unit.Speed.METRES_PER_SECOND);       // returns 36

Test-Driven Development

The API definition and all conversion operations are covered by jasmine tests. The test suite can be executed straightaway and easily, for example:

  • Test directly in the browser Simply open test/index.html in the browser

  • PhantomJs via Karma test driver npm run-script karma That command is just a shorthand for node_modules/.bin/karma start. If you have karma-cli already installed globally, you can also just do karma start. Karma will startup and run all tests on phantomjs

  • Any Browser you like with Karma

    1. Set singleRun:false in ./karma.conf.js
    2. Start the Karma with npm run-script karma or npm test or ... (see above)
    3. navigate any browser you'd like to test to http://localhost:9876
    4. observe the output on the test console

Roadmap

For current and future state of affairs, have a peek at the Roadmap in the root project folder.

Get it

Currently you only need to download and include measurement.js in your project.

latest release - install via NPM:

In case the node package manager is part of your development stack, this may be more comfortable for you:

NPM

Currently tested platforms

Please feel free to add your own test results.

PhantomJS 1.9.7 (Linux): Executed 46 of 46 SUCCESS (0.027 secs / 0.022 secs)
Chrome 18.0.1025 (Linux): Executed 46 of 46 SUCCESS (0.06 secs / 0.035 secs)
Firefox 28.0.0 (Ubuntu): Executed 46 of 46 SUCCESS (0.037 secs / 0.026 secs)

Inspiring projects

  • http://www.codeproject.com/Articles/23087/Measurement-Unit-Conversion-Library (a C# / XML based approach)
  • http://momentjs.com/ (Beautiful & small code base, great simplistic API - role model for MeasurementJs)
  • http://www.convert-me.com/en/convert/weight/ (all possible conversions one could think of already implemented in JS)