
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@webgap/format-utils
Advanced tools
Common formatter utilities to handle numbers, dates, times, etc.
This is the format utilities module for WebGAP. Contains formatter for Dates, String, Numbers, Bytes and Percentage.
Loads default configuration using @webgap/configuration.
Depends on String for string format.
Depends on Numeral for number format.
A configuration file must exist (check @webgap/configuration documentation).
npm install @webgap/format-utils --save
var format = require('@webgap/format-utils').format();
...
// using default options will output:
format.bytes(256000); // returns 256KB
format.percentage(1); // returns 100.00%
format.number(10); // returns 10.00
format.currentDateTimeUnix(); // returns e.g 1318781876406
format.date(1318781876406); // returns 2011-10-16 +00:00
format.dateTime(1318781876406); // returns 2011-10-16T16:17:56 +00:00
format.dateFromNow(1318781876406); // returns e.g. 4 years ago
format.truncate('This is a long string that should be truncated...lets make it a bit longer...and a bit longer...', 20); //
var options = {
dateFormat: "YYYY-MM-DD Z",
dateTimeFormat: "YYYY-MM-DDTHH:mm:ss Z",
timeFormat: "HH:mm:ss Z",
decimalFormat: "0,0.00",
percentageFormat: "0.00%",
byteFormat: "0.0b"
};
var format = require('@webgap/format-utils').format(options);
...
format.percentage(1); // 100.00%
...
Check tests for more examples.
Apache License, Version 2.0
FAQs
Common formatter utilities to handle numbers, dates, times, etc.
The npm package @webgap/format-utils receives a total of 5 weekly downloads. As such, @webgap/format-utils popularity was classified as not popular.
We found that @webgap/format-utils 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.

Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.

Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.

Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.