Split a large XML file into smaller chunks based on the given options


* Go to the directory where you cloned the repository.
* Run npm install @jordanebachelet/xml-split.
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:
``bashwithout npm link
node bin/cli.js 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 ...$3
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:
`javascript
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');
});
``Please check the docs folder here.