@jordanebachelet/xml-split
Split a large XML file into smaller chunks based on the given options
Last updated 2 years ago by jordanebachelet .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @jordanebachelet/xml-split 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 1.1.4                                ...           latest (2 years ago)

10 Versions

  • 1.1.4                                ...           2 years ago
  • 1.1.3                                ...           2 years ago
  • 1.1.2                                ...           2 years ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 11
Last Month 15
Dependencies (14)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |