xml-compiler
v1.0.1
Published
XML and JSON compiler based on JXON
Downloads
7
Readme
xml-compiler
XML and JSON Compiler based on the documentation of JXON
npm install xml-compiler --save
Try it out
node example
API
new XMLCompiler(config)
Create a new instance of the XMLCompiler
- config - Object based on JXON [optional]
XMLCompiler.toJSON(DocObject)
Create a new JSON file from an XML file. Returns the corresponding JSON object from the Promise.
DocObject
| Property | Type | Description | Required | | -------- | ---- | ----------- | -------- | | docPaths | Array (String) | Array of paths to the target files. | Yes | | destDir | String | Path destination for the compiled files. | No | | jsOut | Bool | Optional JS file to be added with the source of the JSON file in a require statement. | No |
For example
{
docPaths: ['some/path/to/file.xml'],
destDir: 'some/output/path'
}