New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ember-railio-convert-unit

Package Overview
Dependencies
Maintainers
5
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-railio-convert-unit

Addon for converting units.

  • 0.0.22
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created
Source

ember-railio-convert-unit

An Ember addon for converting units.

Install

In your application's directory:

$ ember install ember-railio-convert-unit

Usage

Available units

These units can be used to pass as fromUnit and toUnit (second and third arguments).

Unit groupAvailable units
Weightskilos, tons
Metricsfeet, teu
Metricsmillimeters, centimeters, meters, kilometers
Timemilliseconds, seconds, minutes, hours

Use as a function

import convertUnit from 'ember-railio-convert-unit';

//            convertUnit(value, fromUnit, toUnit)
let meters  = convertUnit(2, 'kilometers', 'meters');
let minutes = convertUnit(2, 'hours', 'minutes');

Use as a computed property

import convertUnitProperty from 'ember-railio-convert-unit';

export default EmberObject.extend({
  //                 convertUnitProperty(propertyName, fromUnit, toUnit)
  lengthInMeters:    convertUnitProperty('lengthInKm', 'kilometers', 'meters'),
  durationInMinutes: convertUnitProperty('duration', 'seconds', 'minutes')
});

For more information on using ember-cli, visit https://ember-cli.com/.

Keywords

FAQs

Package last updated on 02 Oct 2019

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