Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command line interface #10

Open
Fleshgrinder opened this issue Sep 27, 2015 · 1 comment
Open

Command line interface #10

Fleshgrinder opened this issue Sep 27, 2015 · 1 comment

Comments

@Fleshgrinder
Copy link

Could you provide a CLI binary for your package, that would be neat.

@ptaferner
Copy link

Not a fully-fledged CLI interface, but a working quick-and-dirty solution ;-)
Write a small script as below and put it into the directory of the node module, then call it via piping.
The script below does XML minifying, so just replace the corresponding function as you like.

#!/usr/bin/env node

process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(data) {
  var pd = require('pretty-data').pd;
  var xml_min = pd.xmlmin(data,true);
  process.stdout.write(xml_min);
  });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants