npm.io
0.7.0 • Published 1 year ago

@dprint/toml

Licence
MIT
Version
0.7.0
Deps
0
Size
912 kB
Vulns
0
Weekly
0
Stars
22

@dprint/toml

npm distribution of dprint-plugin-toml.

Use this with @dprint/formatter or just use @dprint/formatter and download the dprint-plugin-toml Wasm file.

Example

import { createFromBuffer } from "@dprint/formatter";
import { getPath } from "@dprint/toml";
import * as fs from "fs";

const buffer = fs.readFileSync(getPath());
const formatter = createFromBuffer(buffer);

console.log(formatter.formatText("test.toml", "key   =   5"));

Keywords