Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Readme
If you haven't heard of TOML, well you're just missing out. Go check it out now. Back? Good.
toml-node supports version 0.4.0 the TOML spec as specified by mojombo/toml@v0.4.0
toml-node is available via npm.
npm install toml
toml-node also works with browser module bundlers like Browserify and webpack.
Say you have some awesome TOML in a variable called someTomlString
. Maybe it came from the web; maybe it came from a file; wherever it came from, it came asynchronously! Let's turn that sucker into a JavaScript object.
var toml = require('toml');
var data = toml.parse(someTomlString);
console.dir(data);
toml.parse
throws an exception in the case of a parsing error; such exceptions have a line
and column
property on them to help identify the offending text.
try {
toml.parse(someCrazyKnuckleHeadedTrblToml);
} catch (e) {
console.error("Parsing error on line " + e.line + ", column " + e.column +
": " + e.message);
}
As of toml-node version 1.0, the streaming interface has been removed. Instead, use a module like concat-stream:
var toml = require('toml');
var concat = require('concat-stream');
var fs = require('fs');
fs.createReadStream('tomlFile.toml', 'utf8').pipe(concat(function(data) {
var parsed = toml.parse(data);
}));
Thanks @ForbesLindesay for the suggestion.
You can use the toml-require package to require()
your .toml
files with Node.js
You can experiment with TOML online at http://binarymuse.github.io/toml-node/, which uses the latest version of this library.
toml-node uses the PEG.js parser generator.
npm install
npm run build
npm test
Any changes to src/toml.peg
requires a regeneration of the parser with npm run build
.
toml-node is tested on Travis CI and is tested against:
toml-node is licensed under the MIT license agreement. See the LICENSE file for more information.
FAQs
TOML parser for Node.js (parses TOML spec v0.4.0)
The npm package toml receives a total of 767,311 weekly downloads. As such, toml popularity was classified as popular.
We found that toml 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.