
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@phensley/unit-converter
Advanced tools
General framework for converting between units. Includes pre-defined factors for conversion between CLDR units.
import { MathContext } from '@phensley/decimal';
import { LENGTH, UnitFactors } from '@phensley/unit-converter';
const factors = new UnitFactors(LENGTH);
const ctx: MathContext = { precision: 7 };
const dst = 'yard';
for (const unit of ['foot', 'mile']) {
const fac = factors.get(unit, dst)!;
for (const n of [1, 1.5, 2, 3, 4, 5, 6, 10]) {
const r = fac.multiply(n, ctx);
const a = `${n} ${unit}`.padStart(10);
const b = `${r.toDecimal(ctx).toString()} ${dst}`.padEnd(14);
const c = `${r.numerator()} \u00F7 ${r.denominator()} ${dst}`;
console.log(`${a} == ${b} ${c}`);
}
console.log();
}
1 foot == 0.3333333 yard 12 ÷ 36 yard
1.5 foot == 0.5 yard 18.0 ÷ 36 yard
2 foot == 0.6666667 yard 24 ÷ 36 yard
3 foot == 1 yard 36 ÷ 36 yard
4 foot == 1.333333 yard 48 ÷ 36 yard
5 foot == 1.666667 yard 60 ÷ 36 yard
6 foot == 2 yard 72 ÷ 36 yard
10 foot == 3.333333 yard 120 ÷ 36 yard
1 mile == 1760 yard 63360 ÷ 36 yard
1.5 mile == 2640 yard 95040.0 ÷ 36 yard
2 mile == 3520 yard 126720 ÷ 36 yard
3 mile == 5280 yard 190080 ÷ 36 yard
4 mile == 7040 yard 253440 ÷ 36 yard
5 mile == 8800 yard 316800 ÷ 36 yard
6 mile == 10560 yard 380160 ÷ 36 yard
10 mile == 17600 yard 633600 ÷ 36 yard
FAQs
Conversions between CLDR units
The npm package @phensley/unit-converter receives a total of 215 weekly downloads. As such, @phensley/unit-converter popularity was classified as not popular.
We found that @phensley/unit-converter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.