1.1.4 • Published 7 years ago

@jordanebachelet/xml-split v1.1.4

Weekly downloads
2
License
MIT
Repository
bitbucket
Last release
7 years ago

XML Split

Coverage Status NPM version

Installation

  • Go to the directory where you cloned the repository.
  • Run npm install @jordanebachelet/xml-split.

How to use

Through command line interface

You can run the npm link command before using this tool. This will allows you to directly run the xmlsplit command in your command line.

Then, you can run the following commands:

# without npm link
node bin/cli.js split path/to/big/xml/file.xml "child_node" -s 10 -p ".part_" -c 0

# with npm link
xmlsplit split path/to/big/xml/file.xml "child_node" -s 10 -p ".part_" -c 0

This command will split the given XML file into chunks of 10 Mb files, renamed as file.part_0.xml, file.part_1.xml, file.part_2.xml ...

Through the Javascript interface

You can use this tool directly in your NodeJS scripts.

The split method returns a native Promise so you can do some work after the method.

Hereafter how to integrate this tool in your scripts:

const xmlSplit = require('xml-split');

xmlSplit.split('path/to/big/xml/file.xml', 'child_node', {
    size: 10,
    pattern: '.part_',
    counter: 0
}).then(() => {
    console.log('split complete');
});

API Reference

Please check the docs folder here.

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago