Gathering detailed insights and metrics for node-base64-image
Gathering detailed insights and metrics for node-base64-image
Gathering detailed insights and metrics for node-base64-image
Gathering detailed insights and metrics for node-base64-image
Download images from remote URLs or use local images and encode/decode them to Base64 string or Buffer object
npm install node-base64-image
Typescript
Module System
Min. Node Version
Node Version
NPM Version
92.9
Supply Chain
91.2
Quality
77.9
Maintenance
100
Vulnerability
100
License
TypeScript (78.22%)
JavaScript (21.78%)
Total Downloads
2,638,827
Last Day
1,936
Last Week
15,225
Last Month
58,582
Last Year
509,849
MIT License
141 Stars
144 Commits
40 Forks
4 Watchers
2 Branches
12 Contributors
Updated on May 18, 2025
Minified
Minified + Gzipped
Latest Version
2.2.0
Package Id
node-base64-image@2.2.0
Unpacked Size
30.77 kB
Size
9.77 kB
File Count
14
NPM Version
10.8.2
Node Version
20.19.0
Published on
Apr 23, 2025
Cumulative downloads
Total Downloads
Last Day
28.6%
1,936
Compared to previous day
Last Week
13.5%
15,225
Compared to previous week
Last Month
-5.4%
58,582
Compared to previous month
Last Year
53%
509,849
Compared to previous year
Easily encode images (from URLs or local files) to Base64 strings or Buffer objects, and decode them back into image files.
npm install node-base64-image --save
1// CommonJS: 2const { encode, decode } = require('node-base64-image'); 3 4// ES Modules / TypeScript: 5import { encode, decode } from 'node-base64-image';
Attribute | Type | Description | Default Value |
---|---|---|---|
string | boolean | If true, returns a base64 string | false |
local | boolean | Set to true to read from a local file | - |
timeout | number | Request timeout in milliseconds | 5000 |
headers | object | Optional headers for remote HTTP requests | - |
Attribute | Type | Description | Default Value |
---|---|---|---|
fname | string | Output filename (without extension) | - |
ext | string | File extension (e.g., jpg, png) | - |
1// encoding a remote jpg to base64 2const url = 'https://example.com/test.jpg'; 3const options = { 4 string: true, 5 headers: { 6 "User-Agent": "my-app" 7 } 8}; 9const image = await encode(url, options); 10 11// encoding a local file 12const localUrl = 'C:/project/test.jpg'; 13const localImage = await encode(url, {string: true, local: true}); 14 15// writing to file named 'example.jpg' 16await decode(image, { fname: 'example', ext: 'jpg' }); 17 18// writing to a sub-directory 19// after creating a directory called 'photos' 20const image = await encode(url, options); 21await decode(image, { fname: './photos/example', ext: 'jpg' });
Read the CONTRIBUTING guide for information.
Licensed under MIT. See LICENSE for more information.
Report a bug in issues
Made with love in Dhaka, Bangladesh by Riyadh Al Nur
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
14 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 10
Reason
security policy file detected
Details
Reason
license file detected
Details
Reason
1 existing vulnerabilities detected
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
Found 3/14 approved changesets -- score normalized to 2
Reason
dependency not pinned by hash detected -- score normalized to 1
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Score
Last Scanned on 2025-06-23
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