Skip to main content

Deno Data Format Converter


Contents

CSV to JSON

Converts a CSV string to JSON

Converting a CSV String

import { CSVtoJSON } from "https://deno.land/x/data-format-converter@v1.0.0/mod.ts";
const csvString =
  "name, age, year\n" +
  "John Doe, 33, 1990\n" +
  "Jane Doe, 31, 1989";
const result = CSVtoJSON(csvString) // [ ["name", "age", "dob"], ["John Doe", ...], ["Jane Doe", ...] ]

JSON to CSV

Converts a JSON object to CSV

Converting a JSON object

import { JSONtoCSV } from "https://deno.land/x/data-format-converter@v1.0.0/mod.ts";
const json = [
  [
    "name", "age", "year"
  ],
  [
    "John Doe", "33", "1990"
  ],
  [
    "Jane Doe", 31, 1989
  ]
];
const result = JSONtoCSV(json) // "name, age, dob\n John Doe, 33, 1990\n Jane Doe, 31, 1989"

JSON to XML

Not yet supported

XML to JSON

Not yet supported