File: bin.js

package info (click to toggle)
node-yarnpkg 1.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 92,980 kB
  • sloc: sh: 323; makefile: 19
file content (18 lines) | stat: -rwxr-xr-x 459 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env node

var fs = require('fs')
var filename = process.argv[2]
var gunzip = require('./')

if (filename === '--help') {
  console.log('Usage: gunzip-maybe filename?')
  console.log('')
  console.log('  cat somefile | gunzip-maybe')
  console.log('  gunzip-maybe somefile')
  console.log('')
  process.exit(0)
}

var input = (!filename || filename === '-') ? process.stdin : fs.createReadStream(filename)

input.pipe(gunzip()).pipe(process.stdout)