cli.js 356 B

12345678910111213141516
  1. #!/usr/bin/env node
  2. 'use strict';
  3. var looseEnvify = require('./');
  4. var fs = require('fs');
  5. if (process.argv[2]) {
  6. fs.createReadStream(process.argv[2], {encoding: 'utf8'})
  7. .pipe(looseEnvify(process.argv[2]))
  8. .pipe(process.stdout);
  9. } else {
  10. process.stdin.resume()
  11. process.stdin
  12. .pipe(looseEnvify(__filename))
  13. .pipe(process.stdout);
  14. }