Gathering detailed insights and metrics for fastimage
Gathering detailed insights and metrics for fastimage
Gathering detailed insights and metrics for fastimage
Gathering detailed insights and metrics for fastimage
react-native-fast-image
🚩 FastImage, performant React Native image component.
@d11/react-native-fast-image
🚩 FastImage, performant React Native image component.
@react-native-oh-tpl/react-native-fast-image
🚩 FastImage, performant React Native image component.
storms-fastimage
FastImage, performant React Native image component.
A module that finds the size and type of an image by fetching and reading as little data as needed.
npm install fastimage
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (98.27%)
JavaScript (1.73%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
ISC License
157 Stars
139 Commits
6 Forks
6 Watchers
1 Branches
2 Contributors
Updated on Apr 25, 2025
Latest Version
6.0.1
Package Id
fastimage@6.0.1
Unpacked Size
21.53 kB
Size
7.48 kB
File Count
14
NPM Version
10.9.0
Node Version
22.12.0
Published on
Dec 28, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A module that finds the size and type of an image by fetching and reading as little data as needed.
http://sw.cowtech.it/fastimage
Just run:
1npm install fastimage
The signature is fastimage.info(source, [options], [callback])
.
The source
argument can be:
http
and https
protocol are supported).The options
object supports the following options:
threshold
: The maximum about of data (in bytes) to downloaded or read before giving up. Default is 4096
.timeout
: The maximum time (in milliseconds) to wait for a URL to be downloaded before giving up. Default is 30000
(30 s).userAgent
: The user agent to use when making HTTP(S) requests. Default is fastimage/$VERSION
.If callback
is not provided, the method returns a Promise
.
1import { info } from 'fastimage' 2 3info('http://fakeimg.pl/1000x1000/', (error, data) => { 4 if (error) { 5 // ... 6 } else { 7 // ... 8 } 9}) 10 11const data = await info('http://fakeimg.pl/1000x1000/')
The callback argument (or the resolved value) will be an object with the following properties:
1{ 2 "width": 1000, // The width of the image in pixels. 3 "height": 1000, // The height of the image in pixels. 4 "type": "png", // The type of the image. Can be one of the supported images formats (see section below). 5 "time": 171.43721 // The time required for the operation, in milliseconds. 6 "analyzed": 979, // The amount of data transferred (in bytes) or read (in case of files or Buffer) to identify the image. 7 "realUrl": "https://fakeimg.pl/1000x1000/", // The final URL of the image after all the redirects. Only present if the source was a URL. 8 "size": 17300, // The size of the image (in bytes). Only present if the source was a URL and if the server returned the "Content-Length" HTTP header. 9}
Calling fastimage.stream
it will return a Writable stream which will emit the info
event once informations are ready.
The stream accepts only the threshold
option.
1import { stream } from 'fastimage' 2 3const pipe = createReadStream('/path/to/image.png').pipe(stream({ threshold: 100 })) 4 5pipe.on('info', data => { 6 // ... 7})
The supported image type are (thanks to the image-size module):
This package only supports to be directly imported in a ESM context.
For informations on how to use it in a CommonJS context, please check this page.
Copyright (C) 2015 and above Shogun (shogun@cowtech.it).
Licensed under the MIT license, which can be found at https://choosealicense.com/licenses/isc.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More