0.1.1 • Published 6 years ago

petals v0.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

petals

Version: 0.1.1

A module that converts a data-file from one format to another.

Converters

ConvertsCommandDescription
JSON to YAMLpetals.JsonToYaml()Converts JSON to YAML
JSON to XMLpetals.JsonToXml()Converts JSON to XML
YAML to JSONpetals.YamlToJson()Converts YAML to JSON
YAML to XMLpetals.YamlToXml()Converts YAML to XML
XML to JSONpetals.XmlToJson()Converts XML to JSON
XML to YAMLpetals.XmlToYaml()Converts XML to YAML

Installation

npm install petals

Initialization

const Petals = require('petals');

Usage

const petals = new Petals('{"firstName": "John", "lastName": "Doe"}');

petals.JsonToXml();

Alternatively you can also initialize petals and then inject the string:

const petals = new Petals();

petals.JsonToXml('{"firstName": "John", "lastName": "Doe"}');

both should return:

<user firstName="John" lastName="Doe">
</user>

Tests

npm run test

Release History

  • 0.1.0 - Initial Release
  • 0.1.1 - Fixed repository link

License

Copyright (c) 2019 F. Rick Reich. Licensed under the terms of the MIT license. http://frickreich.mit-license.org/