Initial commit

This commit is contained in:
Developer
2025-04-21 16:03:20 +02:00
commit 2832896157
22874 changed files with 3092801 additions and 0 deletions

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)

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);
};

View File

@@ -0,0 +1,66 @@
{
"_from": "is-zip@^1.0.0",
"_id": "is-zip@1.0.0",
"_inBundle": false,
"_integrity": "sha1-R7Co/004p2QxzP2ZqOFaTIa6IyU=",
"_location": "/is-zip",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "is-zip@^1.0.0",
"name": "is-zip",
"escapedName": "is-zip",
"rawSpec": "^1.0.0",
"saveSpec": null,
"fetchSpec": "^1.0.0"
},
"_requiredBy": [
"/decompress-unzip"
],
"_resolved": "https://registry.npmjs.org/is-zip/-/is-zip-1.0.0.tgz",
"_shasum": "47b0a8ff4d38a76431ccfd99a8e15a4c86ba2325",
"_spec": "is-zip@^1.0.0",
"_where": "D:\\developments\\teaser-inertia\\nova-components\\NovaLeader\\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"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Check if a Buffer/Uint8Array is a ZIP file",
"devDependencies": {
"ava": "0.0.4",
"read-chunk": "^1.0.0"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js"
],
"homepage": "https://github.com/kevva/is-zip#readme",
"keywords": [
"archive",
"buffer",
"check",
"detect",
"zip",
"type",
"uint8array"
],
"license": "MIT",
"name": "is-zip",
"repository": {
"type": "git",
"url": "git+https://github.com/kevva/is-zip.git"
},
"scripts": {
"test": "node test/test.js"
},
"version": "1.0.0"
}