Installations
npm install is-png
Developer Guide
Typescript
No
Module System
ESM
Min. Node Version
>=12
Node Version
14.17.5
NPM Version
7.20.3
Score
99.7
Supply Chain
77.1
Quality
75.5
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (63.64%)
TypeScript (36.36%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
sindresorhus
Download Statistics
Total Downloads
288,268,533
Last Day
131,564
Last Week
703,361
Last Month
2,961,738
Last Year
34,447,858
GitHub Statistics
MIT License
47 Stars
20 Commits
4 Forks
7 Watchers
1 Branches
5 Contributors
Updated on Feb 06, 2025
Bundle Size
332.00 B
Minified
233.00 B
Minified + Gzipped
Sponsor this package
Package Meta Information
Latest Version
3.0.1
Package Id
is-png@3.0.1
Size
1.79 kB
NPM Version
7.20.3
Node Version
14.17.5
Published on
Sep 02, 2021
Total Downloads
Cumulative downloads
Total Downloads
288,268,533
Last Day
-1.8%
131,564
Compared to previous day
Last Week
2.7%
703,361
Compared to previous week
Last Month
30.4%
2,961,738
Compared to previous month
Last Year
-13.8%
34,447,858
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
5
is-png
Check if a Buffer/Uint8Array is a PNG image
Install
$ npm install is-png
Usage
Node.js
1import {readChunk} from 'read-chunk'; 2import isPng from 'is-png'; 3 4const buffer = await readChunk('unicorn.png', {length: 8}); 5 6isPng(buffer); 7//=> true
Browser
1import isPng from 'is-png'; 2 3const response = await fetch('unicorn.png'); 4const buffer = await response.arrayBuffer(); 5 6isPng(new Uint8Array(buffer)); 7//=> true
API
isPng(buffer)
Accepts a Buffer (Node.js) or Uint8Array. Returns a boolean
of whether buffer
is a PNG image.
buffer
The buffer to check. It only needs the first 8 bytes.
Related
- file-type - Detect the file type of a Buffer/Uint8Array/ArrayBuffer

No vulnerabilities found.
Reason
security policy file detected
Details
- Info: security policy file detected: .github/security.md:1
- Info: Found linked content: .github/security.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: .github/security.md:1
- Info: Found text in security policy: .github/security.md:1
Reason
no dangerous workflow patterns detected
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 4/20 approved changesets -- score normalized to 2
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
- Warn: no topLevel permission defined: .github/workflows/main.yml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/is-png/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/is-png/main.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/main.yml:20
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
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 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 4 are checked with a SAST tool
Score
4.2
/10
Last Scanned on 2025-02-03
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