A module that converts a data-file from one format to another.
npm install petalsA module that converts a data-file from one format to another.
| Converts | Command | Description |
| ------------ | ------------------------- | --------------------- |
| JSON to YAML | ``petals.JsonToYaml()` | Converts JSON to YAML |`
| JSON to XML | petals.JsonToXml()` | Converts JSON to XML |`
| YAML to JSON | petals.YamlToJson()` | Converts YAML to JSON |`
| YAML to XML | petals.YamlToXml()` | Converts YAML to XML |`
| XML to JSON | petals.XmlToJson()` | Converts XML to JSON |`
| XML to YAML | petals.XmlToYaml()` | Converts XML to YAML |
`shell`
npm install petals
js
const petals = new Petals('{"firstName": "John", "lastName": "Doe"}');petals.JsonToXml();
`Alternatively you can also initialize petals and then inject the string:
`js
const petals = new Petals();petals.JsonToXml('{"firstName": "John", "lastName": "Doe"}');
`both should return:
`xml
`Tests
`shell
npm run test
``Copyright (c) 2019 F. Rick Reich. Licensed under the terms of the MIT license. http://frickreich.mit-license.org/