Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@harvest-profit/units
Advanced tools
To add this package to your project
yarn add @harvest-profit/units
To use, try the following:
import UnitsHelper from '@harvest-profit/units'
const isCompatibleUnit = UnitsHelper.isCompatibleUnit('lbs', 'tons');
console.log(isCompatibleUnit); // true
More commonly, you will use the line item/product functions or to generate units for select boxes
UnitsHelper.perAcreCost(product, item, acres) // 3.50
UnitsHelper.listAvailableUnits(product) // ['gallons', 'floz', 'milliliters', ...]
All of this is build off of the Units
object and a set of definitions declared in this repo.
You can use this object to handle any conversions or any other interaction with those units.
import { Units } from '@harvest-profit/units';
const amount = new Units(1, 'gallon');
amount.to('pints').toNumber() // 8 pints
amount.isCompatible('lbs') // false
// Can use any different name. If a name is missing, just add it to the aliases in the definition in a PR
const gal = new Units(1, 'gal');
const gallon = new Units(1, 'gallon');
const gallons = new Units(1, 'gallons');
Units.selectableUnits('liquid') // ['gallons', 'floz', 'milliliters', ...]
Units.isCompatible('g', 'lb') // true
Units.isCompatible(gallon, 'lb') // false
Units.isCompatible(gal, gallon) // true
To deploy a new version to NPM, bump the version number, commit/merge to master
, and run the following:
yarn run clean
yarn run build
# Either NPM
npm publish --access public
# Or Yarn, they do the same thing
yarn publish --access public
This project is MIT licensed
FAQs
Units helper for Harvest Profit javascript applications
The npm package @harvest-profit/units receives a total of 0 weekly downloads. As such, @harvest-profit/units popularity was classified as not popular.
We found that @harvest-profit/units demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.