|
|
пре 1 година | |
|---|---|---|
| .. | ||
| .npmignore | пре 1 година | |
| .travis.yml | пре 1 година | |
| LICENSE | пре 1 година | |
| README.md | пре 1 година | |
| index.js | пре 1 година | |
| package.json | пре 1 година | |
Check if a given Buffer or Uint8Array is
deflate compressed.
npm install is-deflate --save
var fs = require('fs')
var zlib = require('zlib')
var isDeflate = require('is-deflate')
var buf = fs.readFileSync('my-file')
if (isDeflate(buf)) {
zlib.inflate(buf, function (err, data) {
if (err) throw err
console.log(data)
})
}
MIT