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-bzip2 [![Build Status](https://travis-ci.org/kevva/is-bzip2.svg?branch=master)](https://travis-ci.org/kevva/is-bzip2)
> Check if a Buffer/Uint8Array is a BZIP2 file
## Install
```sh
$ npm install --save is-bzip2
```
## Usage
```js
var isBzip2 = require('is-bzip2');
var read = require('fs').readFileSync;
isBzip2(read('foo.bz2'));
// => 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 BZIP2 file
*
* @param {Buffer} buf
* @api public
*/
module.exports = function (buf) {
if (!buf || buf.length < 3) {
return false;
}
return buf[0] === 66 && buf[1] === 90 && buf[2] === 104;
};
+97
View File
@@ -0,0 +1,97 @@
{
"_args": [
[
{
"raw": "is-bzip2@^1.0.0",
"scope": null,
"escapedName": "is-bzip2",
"name": "is-bzip2",
"rawSpec": "^1.0.0",
"spec": ">=1.0.0 <2.0.0",
"type": "range"
},
"c:\\xampp\\htdocs\\laravel\\node_modules\\decompress-tarbz2"
]
],
"_from": "is-bzip2@>=1.0.0 <2.0.0",
"_id": "is-bzip2@1.0.0",
"_inCache": true,
"_location": "/is-bzip2",
"_npmUser": {
"name": "kevva",
"email": "kevinmartensson@gmail.com"
},
"_npmVersion": "1.4.23",
"_phantomChildren": {},
"_requested": {
"raw": "is-bzip2@^1.0.0",
"scope": null,
"escapedName": "is-bzip2",
"name": "is-bzip2",
"rawSpec": "^1.0.0",
"spec": ">=1.0.0 <2.0.0",
"type": "range"
},
"_requiredBy": [
"/decompress-tarbz2"
],
"_resolved": "https://registry.npmjs.org/is-bzip2/-/is-bzip2-1.0.0.tgz",
"_shasum": "5ee58eaa5a2e9c80e21407bedf23ae5ac091b3fc",
"_shrinkwrap": null,
"_spec": "is-bzip2@^1.0.0",
"_where": "c:\\xampp\\htdocs\\laravel\\node_modules\\decompress-tarbz2",
"author": {
"name": "Kevin Mårtensson",
"email": "kevinmartensson@gmail.com",
"url": "https://github.com/kevva"
},
"bugs": {
"url": "https://github.com/kevva/is-bzip2/issues"
},
"dependencies": {},
"description": "Check if a Buffer/Uint8Array is a BZIP2 file",
"devDependencies": {
"ava": "0.0.4",
"read-chunk": "^1.0.0"
},
"directories": {},
"dist": {
"shasum": "5ee58eaa5a2e9c80e21407bedf23ae5ac091b3fc",
"tarball": "https://registry.npmjs.org/is-bzip2/-/is-bzip2-1.0.0.tgz"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js"
],
"gitHead": "2c6e3c358c31059f7f3c57a4a56b6efbba01ea7b",
"homepage": "https://github.com/kevva/is-bzip2",
"keywords": [
"archive",
"buffer",
"bzip2",
"check",
"detect",
"type",
"uint8array"
],
"license": "MIT",
"maintainers": [
{
"name": "kevva",
"email": "kevinmartensson@gmail.com"
}
],
"name": "is-bzip2",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/kevva/is-bzip2.git"
},
"scripts": {
"test": "node test/test.js"
},
"version": "1.0.0"
}