npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

easy-konvertor

v1.0.6

Published

easy-konvertor ===========

Readme

easy-konvertor

Ever had the urge to parse JSON to XML or CSV to JSON? And wanted to access the data in some sane, easy way? Then easy-konvertor is what you're looking for!

Description

Simple JSON to XML converter.

Installation

Simplest way to install easy-konvertor is to use npm, just npm install easy-konvertor which will download easy-konvertor and all dependencies.

Usage

No extensive tutorials required because you are a smart developer! The task of parsing JSON should be an easy one, so let's make it so! Here's some examples.

Convert a JSON file into XML:

import { Convertor } from "easy-konvertor";

let xml = Convertor.readJson("<path_file>").convert(FileTypeEnum.XML);
console.log(xml);

Convert a pre-loaded JSON string

import { Convertor } from "easy-konvertor";

const json = `{
        "employees": {
          "employee": [{
              "name": "John",
              "surname": "Dalton",
              "age": 40
            },
            {
              "name": "Harry",
              "surname": "McCormick",
              "age": 45
            }
          ]
        }
      `
let xml = Convertor.json2xml(json);
console.log(xml);

This should output the following XML document:

<employees>
  <employee>
    <name>John</name>
    <surname>Dalton</surname>
    <age>40</age>
  </employee>
  <employee>
    <name>Harry</name>
    <surname>McCormick</surname>
    <age>45</age>
  </employee>
</employees>

Use options for XML formatting

let options = {
                padding: 2,
                XMLHeader: true
               }
Convertor.options(options).json2xml(json);

Options: | Parameter | Description | Default | |------------------|---------------------------------------------------------------------|---------| | XMLHeader | If true add the XML XMLHeader | false | | padding | Number of blank for indenting elements.If not present a tab is used | | | root | A string to wrap around the rendered XML document | |

Beautify existing XML string

import { Convertor } from "easy-konvertor";
let xml = `<employees>
            <employee>
            <name>John</name>
            <surname>Dalton</surname>
            <age>40</age>
            </employee>
            <employee>
            <name>Harry</name>
            <surname>McCormick</surname>
            <age>45</age>
            </employee>
            </employees>`

let pad = "  ";
xml = Convertor.beautifyXml(xml, pad)

Format XML with an optional pad string. If not present a tab character is used. The output xml is like this:

<employees>
  <employee>
    <name>John</name>
    <surname>Dalton</surname>
    <age>40</age>
  </employee>
  <employee>
    <name>Harry</name>
    <surname>McCormick</surname>
    <age>45</age>
  </employee>
</employees>

Convert a CSV into JSON

import { Convertor, FileTypeEnum } from "easy-konvertor";

//Convert a string read from a file
Convertor.readCsv("<file name>").convert(FileTypeEnum.JSON);

//Use 'csvHeader' if the header is not present or you want to override it
Convertor.csvHeader("name;lastname;age").readCsv("<file name>").convert(FileTypeEnum.JSON);

Convert a preloaded CSV string into JSON

import { Convertor, FileTypeEnum } from "easy-konvertor";

//if the header is not present or you want to override it
Convertor.csv2json("<csv string>");