
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
Construction in America relies a lot on the imperial mesuring system (which makes me extremely sad). I wanted a way to easily convert units on my website for readers that are only comfortable with one format. You can see the package at work at karelledru.com.
DISCLAMER: This package is not really production ready. There is still quite some work needed. Use at your own risk but feel free to open tickets or PRs if you want to use/contribute.
1/2" (half an inch)6ft 4in1.94mLimitations:
' and " are respectively the shorthands for foot and inch, you cannot use these to separate thousands (like 1'000)Install via yarn/npm:
yarn global add measures
And start using:
Measures = require('measures')
new Measures().from('6ft 4in 1/2').to('m')
from(string)Measures can parse single units:
10cm28 m6 inchesAs well as combined units and fractions:
6' 4"5" 1/25 1/2 "The supported units are:
m, meter, meterskm, kilometer, kilometerscm, centimeter, centimetersmm, millimeter, millimeters', ft, foot, feet", in, inch, inchesyd, yard, yardsmi, mile, milesto(stringOrArray)Measures can convert a string to a single unit or multiple ones. You can use any of the units listed above. You can also add a precision (replace * with the unit you want):
*-round will return the rounded value*-floor will return the rounded value downwards to the closest integer*-ceil will return the rounded value upwards to the closest integer*-n where n is an integer (like *-2) will allow n decimal digitFor inches, you might want to format it as a fraction. You can do that with the precision:
*-/n where n is an integer in [2, 4, 8, 16, 32, 64]. So *-/8 will return fraction where the denominator is 8 or less.Measures can parse any fraction you input but only returns an irreducible fraction up to a /64 precision.
Do what you want with this. Feel free to contribute, fork, love, hate...
IMPORTANT: I will not merge a PR without proper testing and documentation.
FAQs
Convert metric to imperial and vice versa
We found that measures demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.