npm.io
1.0.5 • Published 4 years agoCLI

largexml2json

Licence
ISC
Version
1.0.5
Deps
2
Size
10 kB
Vulns
1
Weekly
0

largexml2json

Description

Command line utility to convert large xml to json line output.

Installation

Requires Node.js to run.

$ npm install largexml2json
$ npm install largexml2json -g
Use it as command line
$ cd /path/to/library
$ npm link
Building for source

For production release:

$ git clone https://github.com/sameer17cs/largexml2json
$ cd largexml2json
$ npm install
Options
  • input: String

    • mandatory
    • filepath of input xml
  • output: String

    • mandatory
    • filepath of output json
    • output as json lines
  • tagtoextract: String

    • mandatory
    • name of xml tag/nested-tag to extract as json
    • content of selected tags will be converted to json line
    • nested content are stored in json field child
  • limit: Number

    • Optional
    • max output buffer size
    • default: 10
    • For higher limit, pass --max-old-space-size args to node
Example
  • largexml2json --input ./test/sample.xml --output ./test/sample.json --tagtoextract book
  • largexml2json --input ./test/sample.xml --output ./test/sample.json --tagtoextract book --limit 100

Keywords