TOML parser and serializer
Compatible with TOML version v1.0.0.
The module passes the TOML test suite, except for the following three test case:
- decoder
- encoder
The reason:
- JavaScript does not define different types of numbers, like integers, short, long, floating-point etc. So @gulujs/toml doesn't preserve type information between integers and floats.
- TomlDate is inherited from JavaScript Date object, the precision of the Date object in JavaScript is typically in milliseconds.
npm install @gulujs/toml
import * as fs from 'fs';
import * as TOML from '@gulujs/toml';
const source = fs.readFileSync('/path/to/file.toml', { encoding: 'utf-8' });
const config = TOML.parse(source);
console.log(config);
console.log(TOML.stringify(config));