cli.js 342 B

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