@aduh95/toml2json

Parses TOML documents and outputs JSON.

Usage no npm install needed!

<script type="module">
  import aduh95Toml2json from 'https://cdn.skypack.dev/@aduh95/toml2json';
</script>

README

toml2json

Parses TOML documents and outputs JSON.

Usage

import { toml2json } from "@aduh95/toml2json";

console.log(
  toml2json(`
[package]
name = "@aduh95/toml2json"
version = "0.1.0"

[dependencies]
serde-transcode = "1.1.0"
serde_json = "1.0.40"
toml = "0.5.3"
wasm-bindgen = "0.2"
`)
);

This outputs:

{
  "dependencies": {
    "serde-transcode": "1.1.0",
    "serde_json": "1.0.40",
    "toml": "0.5.3",
    "wasm-bindgen": "0.2"
  },
  "package": {
    "name": "@aduh95/toml2json",
    "version": "0.1.0"
  }
}

Build

You need NodeJS and wasm-pack.

$ npm run build