Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@hoodmane/toml-j0.4
Advanced tools
As its name TOML-j0.4 says, this is a TOML v0.4.0 compliant parser built with PEG.js. You can customize it easily by modifying the grammar file toml.pegjs
.
http://jakwings.github.io/toml-j0.4/
You can install it via npm install toml-j0.4
, or just include the script dist/toml-browser.js
in your web pages.
var toml = toml || require('toml-j0.4');
try {
var data = toml.parse(src);
} catch (err) {
if (err instanceof toml.SyntaxError) {
// do something
}
}
toml.parse
only accept one argument — data text in TOMLtoml.SyntaxError
has these properties:
line
: the line numbercolumn
: the column numberoffset
: the zero-based offset from the start of the textmessage
: error messageThere is no other API for now.
This parser does not support big integer, until a major version change happens.
All numbers are floats. Any integer bigger than Number.MAX_SAFE_INTEGER
(9007199254740991 < 2^63 - 1) or smaller than Number.MIN_SAFE_INTEGER
(-9007199254740991 > -(2^63 - 1)) is not safe when being converted or used as pure integer!
But you can still store big integers as strings.
RFC 3339 is not the sole criterion of truth.
You can't imagine how terrible all minitue details of the standard are! So don't expect some date-times will work anytime and anywhere, for instance, "2015-02-29T00:00:00Z", "2015-12-25T24:00:00Z", "2015-11-10T00:60:00Z", "2015-11-10T00:00:60Z", "2015-12-25T24:00:00+24:00", "0000-01-01T00:00:00Z".
If you found bugs, welcome to send me a pull request with (only) updated test scripts/fixtures!
In order to test this package thoroughly, you have to do these first:
npm install
The scripts lib/parser.js
and dist/toml-browser.js
are generated via this command:
npm run build
Then you can test them via this command:
npm test
You can also do some benchmarks with other TOML parsers:
npm run benchmark
This package is also used by other projects:
FAQs
A parser only compliant with TOML v0.4.0
The npm package @hoodmane/toml-j0.4 receives a total of 1 weekly downloads. As such, @hoodmane/toml-j0.4 popularity was classified as not popular.
We found that @hoodmane/toml-j0.4 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
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.