Gathering detailed insights and metrics for postcss-image-inliner
Gathering detailed insights and metrics for postcss-image-inliner
Gathering detailed insights and metrics for postcss-image-inliner
Gathering detailed insights and metrics for postcss-image-inliner
npm install postcss-image-inliner
Module System
Unable to determine the module system for this package.
Min. Node Version
Typescript Support
Node Version
NPM Version
16 Stars
315 Commits
6 Forks
3 Watching
2 Branches
5 Contributors
Updated on 06 Oct 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
15.1%
5,680
Compared to previous day
Last week
3.1%
27,969
Compared to previous week
Last month
8.6%
116,950
Compared to previous month
Last year
-2.8%
1,372,017
Compared to previous year
4
1
PostCSS plugin to inline local/remote images.
1.foo { 2 /* Input example */ 3 background-image: url('https://placehold.it/10x10'); 4}
1.foo { 2 /* Output example */ 3 background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAo ... ORK5CYII='); 4}
1npm i -D postcss postcss-image-inliner
1const postcss = require('postcss'); 2const imageInliner = require('postcss-image-inliner'); 3const opts = { 4 assetPaths: [], // List of directories where the inliner should look for assets 5 maxFileSize: 10240, // Sets a max file size (in bytes) 6}; 7 8postcss([imageInliner(opts)]);
See PostCSS docs for examples for your environment.
array
[process.cwd()]
['http://domain.de/', 'http://domain.de/styles', 'app/images', '**/images/']
false
List of directories/URLs where the inliner should start looking for assets. You can define local directories (globs supported) or URLs.
int
10240
0
false
Sets a max file size (in bytes) for inlined images. Set to 0
to disable size checking.
function
function (file) { console.log('big file found:', file.path); return file.path }
false
Allows you to act on large files and change the url if you'd like. Make sure you have strict
set to false
when using this.
bool
false
false
Use Base64 encoding for SVGs.
array
[]
false
Use custom svgo configuration for svg optimization
bool
false
false
Fail on error.
regex
/^(background(?:-image)?)|(content)|(cursor)/
false
Regex to match the CSS properties to be inlined.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
1 existing vulnerabilities detected
Details
Reason
4 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 3
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
Found 2/11 approved changesets -- score normalized to 1
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
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
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