Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@toddself/split-measure-units
Advanced tools
Separate English style measures (1 gal) into their amounts and units, and optionally convert to other units
A small function that will separate out the amount from the units in a normal English measurement phrase, and optionally convert it to a different unit
This is authored as an ES6 module and relies on ES6 features. The main
key in package.json
points to the transpiled ES5 source, but the jsnext:main
key points to the ES6 original source. If your environement supports:
let
& const
)let [abbott, costello] = ['abbot', 'costello']
)import
and export
Then feel free to use the ES6 source directly.
import splitMeasure from 'split-measure-units'
console.log(splitMeasure('1 cup')) // [1, 'cup', 'cup']
console.log(splitMeasure('12 minutes')) // [12, 'minutes', 'minutes']
console.log(splitMeasure('62.45 hampsters')) // [62.45, 'hampsters', 'hampsters']
console.log(splitMeasure('1 gal', 'qt')) // [4, 'qt', 'gal']
The method takes two arguments: the measurement and an optional unit to convert to. For conversions is relies on convert-units, so see that documentation for what units it can convert. It will also support converting between Farhenheit and Celsius independant of the convert-units library
FAQs
Separate English style measures (1 gal) into their amounts and units, and optionally convert to other units
The npm package @toddself/split-measure-units receives a total of 4 weekly downloads. As such, @toddself/split-measure-units popularity was classified as not popular.
We found that @toddself/split-measure-units 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.