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
90.8
Supply Chain
91.2
Quality
85.1
Maintenance
100
Vulnerability
100
License
TypeScript (78.22%)
JavaScript (21.78%)
Total Downloads
2,580,245
Last Day
1,938
Last Week
13,975
Last Month
61,942
Last Year
482,869
MIT License
140 Stars
144 Commits
40 Forks
4 Watchers
2 Branches
13 Contributors
Updated on Apr 27, 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
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
18 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 10
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
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
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is not fuzzed
Details
Score
Last Scanned on 2025-04-21
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 MoreLast Day
-9.4%
1,938
Compared to previous day
Last Week
-0.2%
13,975
Compared to previous week
Last Month
28.8%
61,942
Compared to previous month
Last Year
47.6%
482,869
Compared to previous year