123456789101112131415161718192021222324252627 |
- #!/usr/bin/env node
- var xml2json = require('../');
- var pkg = require('../package.json');
- var xml = '';
- var args = process.argv.slice(2)
- var arg = args[0]
- if (arg == '--version') {
- console.log(pkg.version)
- process.exit(0)
- }
- process.stdin.on('data', function (data) {
- xml += data;
- });
- process.stdin.resume();
- process.stdin.on('end', function () {
- json = xml2json.toJson(xml)
- process.stdout.write(json + '\n')
- });
|