Skip to content

gulujs/toml

Repository files navigation

@gulujs/toml

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:

The reason:

  1. 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.
  2. TomlDate is inherited from JavaScript Date object, the precision of the Date object in JavaScript is typically in milliseconds.

Installation

npm install @gulujs/toml

Usage

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));

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published