Installations
npm install @use-hooks/image-size
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
8.13.0
NPM Version
6.4.1
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (90.73%)
HTML (9.27%)
Developer
use-hooks
Download Statistics
Total Downloads
32,343
Last Day
2
Last Week
42
Last Month
294
Last Year
4,450
GitHub Statistics
19 Stars
17 Commits
2 Forks
2 Watching
3 Branches
3 Contributors
Package Meta Information
Latest Version
1.0.5
Package Id
@use-hooks/image-size@1.0.5
Unpacked Size
6.72 kB
Size
3.08 kB
File Count
4
NPM Version
6.4.1
Node Version
8.13.0
Total Downloads
Cumulative downloads
Total Downloads
32,343
Last day
-77.8%
2
Compared to previous day
Last week
-10.6%
42
Compared to previous week
Last month
-48.4%
294
Compared to previous month
Last year
-7.2%
4,450
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
react-hooks-image-size
Custom React Hooks for image natural size.
Install
Note: Make sure that you have installed the correct version of
react(>= v16.8.0)
andreact-dom(>= v16.8.0)
.
npm
1npm install --save @use-hooks/image-size
yarn
1yarn add @use-hooks/image-size
API
Params
1/** 2 * Params 3 * @param {string} url - The image url 4 */
Returns
1/** 2 * Returns 3 * @param {array} size - The image size [width, height] 4 */
Usage
1import React from 'react'; 2 3import useImageSize from '@use-hooks/image-size'; 4 5export default function App() { 6 const url = 'https://cdn.int64ago.org/ogk39i54.png'; 7 const [width, height] = useImageSize(url); 8 9 return ( 10 <div> 11 <h2>DEMO of <span style={{ color: '#F44336' }}>@use-hooks/image-size</span></h2> 12 <div> 13 <img src={url} width={100} height={100} alt="" /> 14 <div>Natural size: {width} x {height}</div> 15 </div> 16 </div> 17 ); 18} 19
Development
Node >= v8 LTS
- Clone the project to local disk
npm install
npm start
License
MIT
Generated by create-react-hooks.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 0/17 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
3
/10
Last Scanned on 2024-12-30
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