This commit is contained in:
chrosey
2017-09-13 07:52:34 +02:00
parent a1f16c37f4
commit 2340b0226b
24621 changed files with 2912161 additions and 149 deletions
+23
View File
@@ -0,0 +1,23 @@
# is-zip [![Build Status](https://travis-ci.org/kevva/is-zip.svg?branch=master)](https://travis-ci.org/kevva/is-zip)
> Check if a Buffer/Uint8Array is a ZIP file
## Install
```sh
$ npm install --save is-zip
```
## Usage
```js
var isZip = require('is-zip');
var read = require('fs').readFileSync;
isZip(read('foo.zip'));
// => true
```
## License
[MIT License](http://en.wikipedia.org/wiki/MIT_License) © [Kevin Mårtensson](https://github.com/kevva)
+16
View File
@@ -0,0 +1,16 @@
'use strict';
/**
* Check if a Buffer/Uint8Array is a ZIP file
*
* @param {Buffer} buf
* @api public
*/
module.exports = function (buf) {
if (!buf || buf.length < 4) {
return false;
}
return buf[0] === 80 && buf[1] === 75 && (buf[2] === 3 || buf[2] === 5 || buf[2] === 7) && (buf[3] === 4 || buf[3] === 6 || buf[3] === 8);
};
+97
View File
@@ -0,0 +1,97 @@
{
"_args": [
[
{
"raw": "is-zip@^1.0.0",
"scope": null,
"escapedName": "is-zip",
"name": "is-zip",
"rawSpec": "^1.0.0",
"spec": ">=1.0.0 <2.0.0",
"type": "range"
},
"c:\\xampp\\htdocs\\laravel\\node_modules\\decompress-unzip"
]
],
"_from": "is-zip@>=1.0.0 <2.0.0",
"_id": "is-zip@1.0.0",
"_inCache": true,
"_location": "/is-zip",
"_npmUser": {
"name": "kevva",
"email": "kevinmartensson@gmail.com"
},
"_npmVersion": "1.4.23",
"_phantomChildren": {},
"_requested": {
"raw": "is-zip@^1.0.0",
"scope": null,
"escapedName": "is-zip",
"name": "is-zip",
"rawSpec": "^1.0.0",
"spec": ">=1.0.0 <2.0.0",
"type": "range"
},
"_requiredBy": [
"/decompress-unzip"
],
"_resolved": "https://registry.npmjs.org/is-zip/-/is-zip-1.0.0.tgz",
"_shasum": "47b0a8ff4d38a76431ccfd99a8e15a4c86ba2325",
"_shrinkwrap": null,
"_spec": "is-zip@^1.0.0",
"_where": "c:\\xampp\\htdocs\\laravel\\node_modules\\decompress-unzip",
"author": {
"name": "Kevin Mårtensson",
"email": "kevinmartensson@gmail.com",
"url": "https://github.com/kevva"
},
"bugs": {
"url": "https://github.com/kevva/is-zip/issues"
},
"dependencies": {},
"description": "Check if a Buffer/Uint8Array is a ZIP file",
"devDependencies": {
"ava": "0.0.4",
"read-chunk": "^1.0.0"
},
"directories": {},
"dist": {
"shasum": "47b0a8ff4d38a76431ccfd99a8e15a4c86ba2325",
"tarball": "https://registry.npmjs.org/is-zip/-/is-zip-1.0.0.tgz"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js"
],
"gitHead": "1951973ac98d3b0d57e7a8c822aee58631bd2ebd",
"homepage": "https://github.com/kevva/is-zip",
"keywords": [
"archive",
"buffer",
"check",
"detect",
"zip",
"type",
"uint8array"
],
"license": "MIT",
"maintainers": [
{
"name": "kevva",
"email": "kevinmartensson@gmail.com"
}
],
"name": "is-zip",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/kevva/is-zip.git"
},
"scripts": {
"test": "node test/test.js"
},
"version": "1.0.0"
}