Package Exports
- json2toml
- json2toml/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (json2toml) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
json2toml
Convert JSON to TOML.
Example
const json2toml = require('json2toml');
json2toml({simple: true});
// => 'simple = true\n'
// Also supports pretty-printing options
json2toml(
{
deeply: {
option: false,
nested: {
option: true
}
}
},
{ indent: 2, newlineAfterSection: true }
);
// => [deeply]
// => option = false
// =>
// => [deeply.nested]
// => option = trueInstallation
$ npm install json2tomlAPI
const json2toml = require('json2toml');json2toml(hash, options = {})
Converts an Object hash to TOML, and returns the result as a String.
options.indent: Number of spaces for indentation.options.newlineAfterSection: Whether or not to output a newline after the last pair in a hash if that hash wasn't empty.
Throws a TypeError if undefined, null, or a sparse array is encountered.