
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
awesome-converter
Advanced tools
An awesome and typesafe unit converter for NodeJS
Install with yarn:
$ yarn add awesome-converter
const {convert, definitions} = require('awesome-converter');
const {inspect} = require('util');
// Or for babel / typescript:
// import { convert, definitions } from 'awesome-querystring';
// import { inspect } from 'util'; ==> Note that this requires @types/node !!
// Just pass required arguments
// expected output: 0.22046244
console.log(convert(100, 'g', 'lb'));
// Specify decimal precision
// expected output: 0.22
console.log(convert(100, 'g', 'lb', {precision: 3}));
// Will not work if you pass units of different groups
// expected error: Cannot convert incompatible unit of g to m
console.log(convert(100, 'g', 'm'));
// Log all supported definitions
console.log(inspect(definitions, {showHidden: false, depth: null}));
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Copyright © 2019, Favna. Released under the MIT License.
This project is open source and always will be, even if I don't get donations. That said, I know there are people out there that may still want to donate just to show their appreciation so this is for you guys. Thanks in advance!
I accept donations through PayPal, BitCoin, Ethereum and LiteCoin. You can use the buttons below to donate through your method of choice
Donate With | QR | Address |
---|---|---|
![]() | ![]() | Donate with PayPal |
![]() | ![]() | 1E643TNif2MTh75rugepmXuq35Tck4TnE5 |
![]() | ![]() | 0xF653F666903cd8739030D2721bF01095896F5D6E |
![]() | ![]() | LZHvBkaJqKJRa8N7Dyu41Jd1PDBAofCik6 |
FAQs
Awesome and typesafe unit converter
The npm package awesome-converter receives a total of 0 weekly downloads. As such, awesome-converter popularity was classified as not popular.
We found that awesome-converter 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
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.