{ "_args": [ [ { "raw": "probe-image-size@^3.1.0", "scope": null, "escapedName": "probe-image-size", "name": "probe-image-size", "rawSpec": "^3.1.0", "spec": ">=3.1.0 <4.0.0", "type": "range" }, "/home/jdaugherty/work/GT2/GT2-Android/node_modules/@expo/schemer" ] ], "_from": "probe-image-size@>=3.1.0 <4.0.0", "_id": "probe-image-size@3.2.0", "_inCache": true, "_location": "/probe-image-size", "_nodeVersion": "8.9.1", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/probe-image-size-3.2.0.tgz_1511312701685_0.1903459308668971" }, "_npmUser": { "name": "vitaly", "email": "vitaly@rcdesign.ru" }, "_npmVersion": "5.5.1", "_phantomChildren": {}, "_requested": { "raw": "probe-image-size@^3.1.0", "scope": null, "escapedName": "probe-image-size", "name": "probe-image-size", "rawSpec": "^3.1.0", "spec": ">=3.1.0 <4.0.0", "type": "range" }, "_requiredBy": [ "/@expo/schemer" ], "_resolved": "https://registry.npmjs.org/probe-image-size/-/probe-image-size-3.2.0.tgz", "_shasum": "0b8d7cd6e8dce8356bec732a1d9e793bcc8aed44", "_shrinkwrap": null, "_spec": "probe-image-size@^3.1.0", "_where": "/home/jdaugherty/work/GT2/GT2-Android/node_modules/@expo/schemer", "bugs": { "url": "https://github.com/nodeca/probe-image-size/issues" }, "dependencies": { "any-promise": "^1.3.0", "deepmerge": "^1.3.0", "got": "^6.7.1", "inherits": "^2.0.3", "next-tick": "^1.0.0", "stream-parser": "~0.3.1" }, "description": "Get image size without full download (JPG, GIF, PNG, WebP, BMP, TIFF, PSD)", "devDependencies": { "coveralls": "^2.11.9", "eslint": "^3.11.1", "from2": "^2.1", "istanbul": "^0.4.1", "mocha": "^3.2.0" }, "directories": {}, "dist": { "integrity": "sha512-LE7mIvfDoEeOgIH9TbMNv5txJh+K0/UVandiXHk+Hm4VKqNV5qxoeDzdW3QiMIlqXsIEm3K+SzeAedT6fZKjtQ==", "shasum": "0b8d7cd6e8dce8356bec732a1d9e793bcc8aed44", "tarball": "https://registry.npmjs.org/probe-image-size/-/probe-image-size-3.2.0.tgz" }, "files": [ "index.js", "http.js", "stream.js", "sync.js", "lib/" ], "gitHead": "784eeb29b8ee09ab417f85bde5cfb9507ee2782b", "homepage": "https://github.com/nodeca/probe-image-size#readme", "keywords": [ "image", "size", "jpg", "jpeg", "gif", "png", "webp", "tiff", "bmp", "svg", "psd" ], "license": "MIT", "maintainers": [ { "name": "vitaly", "email": "vitaly@rcdesign.ru" } ], "name": "probe-image-size", "optionalDependencies": {}, "readme": "probe-image-size\n================\n\n[![Build Status](https://img.shields.io/travis/nodeca/probe-image-size/master.svg?style=flat)](https://travis-ci.org/nodeca/probe-image-size)\n[![NPM version](https://img.shields.io/npm/v/probe-image-size.svg?style=flat)](https://www.npmjs.org/package/probe-image-size)\n[![Coverage Status](https://coveralls.io/repos/github/nodeca/probe-image-size/badge.svg?branch=master)](https://coveralls.io/github/nodeca/probe-image-size?branch=master)\n\n> Get image size without full download. Supported image types:\n> JPG, GIF, PNG, WebP, BMP, TIFF, SVG, PSD.\n\nKey features:\n\n- small size, no heavy dependencies\n- works with remote and local data\n- effective with big images (speed/memory), download minimal data from remotes\n- easy to browserify (splitted to components)\n\n\nInstall\n-------\n\n```bash\nnpm install probe-image-size --save\n```\n\nExample\n-------\n\n```js\nvar probe = require('probe-image-size');\n\n// Get by URL\n//\nprobe('http://example.com/image.jpg').then(result => {\n console.log(result); // =>\n /*\n {\n width: xx,\n height: yy,\n type: 'jpg',\n mime: 'image/jpeg',\n wUnits: 'px',\n hUnits: 'px',\n url: 'http://example.com/image.jpg'\n }\n */\n});\n\n// By URL with options\n//\nprobe('http://example.com/image.jpg', { timeout: 5000 }).then(function (result) {\n console.log(result);\n});\n\n// With callback\n//\nprobe('http://example.com/image.jpg', function (err, result) {\n console.log(result);\n});\n\n// From the stream\n//\nvar input = require('fs').createReadStream('image.jpg');\n\nprobe(input).then(result => {\n console.log(result);\n\n // terminate input, depends on stream type,\n // this example is for fs streams only.\n input.destroy();\n});\n\n// From a Buffer\n//\nvar data = require('fs').readFileSync('image.jpg');\n\nconsole.log(probe.sync(data));\n```\n\n\nAPI\n---\n\n### probe(src [, options, callback]) -> Promise\n\n`src` can be of this types:\n\n- __String__ - URL to fetch\n- __Stream__ - readable stream\n\n`options` - HTTP only. See [`got` documentation](https://github.com/sindresorhus/got).\nDefaults changed to `{ retries: 1, timeout: 30000 }`\n\n`result` (Promise) contains:\n\n```js\n{\n width: XX,\n height: YY,\n length: ZZ, // byte length of the file (if available, HTTP only)\n type: ..., // image 'type' (usual file name extention)\n mime: ..., // mime type\n wUnits: 'px', // width units type ('px' by default, can be different for SVG)\n hUnits: 'px', // height units type ('px' by default, can be different for SVG)\n url: ..., // last url for the image in chain of redirects (if no redirects, same as src) (HTTP only)\n}\n```\n\nReturned errors can be extended with 2 fields:\n\n- `code` - equals to `ECONTENT` if the library failed to parse the file;\n- `status` - equals to a HTTP status code if it receives a non-200 response.\n\nIf callback (legacy node style) provided, `Promise` will not be returned.\n\n__Note 1.__ If you use `Stream` as source, it's your responsibility to close that\nstream in callback. In other case you can get memory leak, because stream will\nbe left in paused state. With http requests that's not a problem - everything\nis released automatically, as soon as possible.\n\n__Note 2.__ We still support legacy v2.x signature for http probe (`src` is\nObject as described in [request](https://github.com/request/request)). But it\nwill be deprecated in next versions.\n\n\n### sync.probe(src) -> result|null\n\nSync version can eat arrays, typed arrays and buffers. On success it returns\nthe same result as async version. On fail it returns null.\n\n__Note.__ Formats like JPEG & TIFF can store size anywhere (far from the head).\nThat usually does not happens, but if you need guarantees - always provide full\nfile content to sync methods. We strongly recommend to use async version\nas memory-friendly.\n\n\nSimilar projects\n----------------\n\n- [image-size](https://github.com/netroy/image-size)\n- [imagesize](https://github.com/arnaud-lb/imagesize.js)\n\n\nLicense\n-------\n\n[MIT](https://raw.github.com/nodeca/probe-image-size/master/LICENSE)\n", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git+https://github.com/nodeca/probe-image-size.git" }, "scripts": { "coverage": "rm -rf coverage && ./node_modules/.bin/istanbul cover node_modules/.bin/_mocha", "lint": "eslint .", "report-coveralls": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage", "test": "npm run lint && ./node_modules/.bin/mocha" }, "version": "3.2.0" }