134 lines
6.4 KiB
JSON
134 lines
6.4 KiB
JSON
{
|
|
"_args": [
|
|
[
|
|
{
|
|
"raw": "image-size@^0.6.0",
|
|
"scope": null,
|
|
"escapedName": "image-size",
|
|
"name": "image-size",
|
|
"rawSpec": "^0.6.0",
|
|
"spec": ">=0.6.0 <0.7.0",
|
|
"type": "range"
|
|
},
|
|
"/Volumes/2009-SSD/GT2/GT2-iOS/node_modules/metro"
|
|
]
|
|
],
|
|
"_from": "image-size@>=0.6.0 <0.7.0",
|
|
"_id": "image-size@0.6.2",
|
|
"_inCache": true,
|
|
"_location": "/image-size",
|
|
"_nodeVersion": "9.2.0",
|
|
"_npmOperationalInternal": {
|
|
"host": "s3://npm-registry-packages",
|
|
"tmp": "tmp/image-size-0.6.2.tgz_1513424120851_0.08952897996641695"
|
|
},
|
|
"_npmUser": {
|
|
"name": "netroy",
|
|
"email": "aditya@netroy.in"
|
|
},
|
|
"_npmVersion": "5.5.1",
|
|
"_phantomChildren": {},
|
|
"_requested": {
|
|
"raw": "image-size@^0.6.0",
|
|
"scope": null,
|
|
"escapedName": "image-size",
|
|
"name": "image-size",
|
|
"rawSpec": "^0.6.0",
|
|
"spec": ">=0.6.0 <0.7.0",
|
|
"type": "range"
|
|
},
|
|
"_requiredBy": [
|
|
"/metro"
|
|
],
|
|
"_resolved": "https://registry.npmjs.org/image-size/-/image-size-0.6.2.tgz",
|
|
"_shasum": "8ee316d4298b028b965091b673d5f1537adee5b4",
|
|
"_shrinkwrap": null,
|
|
"_spec": "image-size@^0.6.0",
|
|
"_where": "/Volumes/2009-SSD/GT2/GT2-iOS/node_modules/metro",
|
|
"author": {
|
|
"name": "netroy",
|
|
"email": "aditya@netroy.in",
|
|
"url": "http://netroy.in/"
|
|
},
|
|
"bin": {
|
|
"image-size": "bin/image-size.js"
|
|
},
|
|
"bugs": {
|
|
"url": "https://github.com/image-size/image-size/issues"
|
|
},
|
|
"dependencies": {},
|
|
"description": "get dimensions of any image file",
|
|
"devDependencies": {
|
|
"coveralls": "^3.0.0",
|
|
"eslint": "^4.13.1",
|
|
"expect.js": "^0.3.1",
|
|
"glob": "^7.1.1",
|
|
"mocha": "^4.0.1",
|
|
"nyc": "^11.2.1",
|
|
"sinon": "^4.0.2"
|
|
},
|
|
"directories": {},
|
|
"dist": {
|
|
"integrity": "sha512-pH3vDzpczdsKHdZ9xxR3O46unSjisgVx0IImay7Zz2EdhRVbCkj+nthx9OuuWEhakx9FAO+fNVGrF0rZ2oMOvw==",
|
|
"shasum": "8ee316d4298b028b965091b673d5f1537adee5b4",
|
|
"tarball": "https://registry.npmjs.org/image-size/-/image-size-0.6.2.tgz"
|
|
},
|
|
"engines": {
|
|
"node": ">=4.0"
|
|
},
|
|
"files": [
|
|
"bin",
|
|
"lib"
|
|
],
|
|
"gitHead": "bbf1e36505ba2d13cce175f64fba2492c84da9fd",
|
|
"homepage": "https://github.com/image-size/image-size#readme",
|
|
"keywords": [
|
|
"image",
|
|
"size",
|
|
"dimensions",
|
|
"resolution",
|
|
"width",
|
|
"height",
|
|
"png",
|
|
"jpeg",
|
|
"bmp",
|
|
"gif",
|
|
"psd",
|
|
"tiff",
|
|
"webp",
|
|
"svg",
|
|
"ico",
|
|
"cur"
|
|
],
|
|
"license": "MIT",
|
|
"main": "lib/index.js",
|
|
"maintainers": [
|
|
{
|
|
"name": "shinnn",
|
|
"email": "snnskwtnb@gmail.com"
|
|
},
|
|
{
|
|
"name": "zeke",
|
|
"email": "zeke@sikelianos.com"
|
|
},
|
|
{
|
|
"name": "netroy",
|
|
"email": "aditya@netroy.in"
|
|
}
|
|
],
|
|
"name": "image-size",
|
|
"optionalDependencies": {},
|
|
"readme": "# image-size\n\n[![NPM Version](https://img.shields.io/npm/v/image-size.svg)](https://www.npmjs.com/package/image-size)\n[![Build Status](https://travis-ci.org/image-size/image-size.svg?branch=master)](https://travis-ci.org/image-size/image-size)\n[![NPM Downloads](https://img.shields.io/npm/dm/image-size.svg)](http://npm-stat.com/charts.html?package=image-size&author=&from=&to=)\n[![Coverage Status](https://img.shields.io/coveralls/image-size/image-size/master.svg)](https://coveralls.io/github/image-size/image-size?branch=master)\n[![devDependency Status](https://david-dm.org/image-size/image-size/dev-status.svg)](https://david-dm.org/image-size/image-size#info=devDependencies)\n\nA [Node](https://nodejs.org/en/) module to get dimensions of any image file\n\n## Supported formats\n\n* BMP\n* CUR\n* GIF\n* ICO\n* JPEG\n* PNG\n* PSD\n* TIFF\n* WebP\n* SVG\n* DDS\n\n### Upcoming\n\n* SWF\n\n## Programmatic Usage\n\n```\nnpm install image-size --save\n```\n\n### Synchronous\n\n```javascript\nvar sizeOf = require('image-size');\nvar dimensions = sizeOf('images/funny-cats.png');\nconsole.log(dimensions.width, dimensions.height);\n```\n\n### Asynchronous\n\n```javascript\nvar sizeOf = require('image-size');\nsizeOf('images/funny-cats.png', function (err, dimensions) {\n console.log(dimensions.width, dimensions.height);\n});\n```\nNOTE: The asynchronous version doesn't work if the input is a Buffer. Use synchronous version instead.\n\n### Using promises (node 8.x)\n```javascript\nvar { promisify } = require('util');\nvar sizeOf = promisify(require('image-size'));\nsizeOf('images/funny-cats.png')\n .then(dimensions => { console.log(dimensions.width, dimensions.height); })\n .catch(err => console.error(err));\n```\n\n### Async/Await (Typescript & ES7)\n```javascript\nvar { promisify } = require('util');\nvar sizeOf = promisify(require('image-size'));\ntry {\n const dimensions = await sizeOf('images/funny-cats.png');\n console.log(dimensions.width, dimensions.height);\n} catch (err) {\n console.error(err);\n}\n```\n\n### Multi-size\n\nIf the target file is an icon (.ico) or a cursor (.cur), the `width` and `height` will be the ones of the first found image.\n\nAn additional `images` array is available and returns the dimensions of all the available images\n\n```javascript\nvar sizeOf = require('image-size');\nvar images = sizeOf('images/multi-size.ico').images;\nfor (const dimensions of images) {\n console.log(dimensions.width, dimensions.height);\n}\n```\n\n### Using a URL\n\n```javascript\nvar url = require('url');\nvar http = require('http');\n\nvar sizeOf = require('image-size');\n\nvar imgUrl = 'http://my-amazing-website.com/image.jpeg';\nvar options = url.parse(imgUrl);\n\nhttp.get(options, function (response) {\n var chunks = [];\n response.on('data', function (chunk) {\n chunks.push(chunk);\n }).on('end', function() {\n var buffer = Buffer.concat(chunks);\n console.log(sizeOf(buffer));\n });\n});\n```\n\nYou can optionally check the buffer lengths & stop downloading the image after a few kilobytes.\n**You don't need to download the entire image**\n\n## Command-Line Usage (CLI)\n\n```\nnpm install image-size --global\nimage-size image1 [image2] [image3] ...\n```\n\n## Credits\n\nnot a direct port, but an attempt to have something like\n[dabble's imagesize](https://github.com/dabble/imagesize/blob/master/lib/image_size.rb) as a node module.\n\n## [Contributors](Contributors.md)\n",
|
|
"readmeFilename": "Readme.md",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/image-size/image-size.git"
|
|
},
|
|
"scripts": {
|
|
"coverage": "nyc report --reporter=text-lcov | coveralls",
|
|
"pretest": "eslint lib specs",
|
|
"test": "nyc mocha specs"
|
|
},
|
|
"version": "0.6.2"
|
|
}
|