Socket
Socket
Sign inDemoInstall

image-size

Package Overview
Dependencies
2
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.2 to 2.0.0-alpha.1

dist/cjs/detector.js

20

package.json
{
"name": "image-size",
"version": "1.0.2",
"version": "2.0.0-alpha.1",
"description": "get dimensions of any image file",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/dts/index.d.ts",
"exports": {
".": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
}
},
"files": [

@@ -12,3 +20,3 @@ "dist",

"engines": {
"node": ">=14.0.0"
"node": ">=16.18.0"
},

@@ -21,4 +29,4 @@ "bin": "bin/image-size.js",

"generate-docs": "typedoc",
"build": "tsc",
"prepack": "yarn clean && yarn build"
"build": "tsc && tsc -p tsconfig.esm.json",
"prepack": "yarn build"
},

@@ -25,0 +33,0 @@ "keywords": [

@@ -58,3 +58,3 @@ # image-size

NOTE: The asynchronous version doesn't work if the input is a Buffer. Use synchronous version instead.
NOTE: The asynchronous version doesn't work if the input is a Uint8Array. Use synchronous version instead.

@@ -124,4 +124,4 @@ Also, the asynchronous functions have a default concurrency limit of **100**

}).on('end', function() {
const buffer = Buffer.concat(chunks)
console.log(sizeOf(buffer))
const input = Buffer.concat(chunks)
console.log(sizeOf(input))
})

@@ -131,3 +131,3 @@ })

You can optionally check the buffer lengths & stop downloading the image after a few kilobytes.
You can optionally check the buffer length & stop downloading the image after a few kilobytes.
**You don't need to download the entire image**

@@ -175,10 +175,3 @@

## Hosted API
We also provide a hosted API for image-size which may simplify your use case.
<a href="https://image-size.saasify.sh">
<img src="https://badges.saasify.sh?text=View%20Hosted%20API" height="40"/>
</a>
## Credits

@@ -185,0 +178,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc