
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
grunt-css-url-embed
Advanced tools

Embed URLs as base64 data URIs inside your stylesheets
There are lots of base64 embedding Grunt plugins out there, but pretty much all of them are already outdated and/or abandoned. This plugin aims to change that.
This plugin requires Grunt ~0.4.0 and Python 2.7, since it depends on node-gyp.
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-css-url-embed --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-css-url-embed');
Task targets, files and options may be specified according to the grunt Configuring tasks guide.
Both image and font URLs are supported. Remote (http, https) URLs are supported as well.
Type: String
Default: . or the directory of Gruntfile.js
The base directory for URLs. Can be absolute or relative to the directory of your Gruntfile.js.
Type: Boolean
Default: true
Will the script terminate if the file referenced by the URL is missing or the request to get it failed?
When set to false a warning will be produced for each missing file or failed request.
Type: String
Default: No restrictions
Skip URLs that are larger than the specified value.
For example: '5 MB', '30 KB', '300 B'.
Type: Boolean
Default: false
Specifies the mode of embedding.
true (inclusive) means that you have to manually mark each URL that needs to be embedded using the /* embed */ comment.false (exclusive) means that every URL is embedded, except those that are marked with /* noembed */ comment.Type: Boolean
Default: true
Should we try to use the mmmagic MIME-type sniffing library or should we always determine MIME-type only from the extension of the URL?
When set to false the extension checking is always used. When set to true it will first try use the mmmagic library. However, in case the library failed to install it will fallback to extension checking.
cssUrlEmbed: {
encodeDirectly: {
files: {
'path/to/output.css': ['path/to/input.css']
}
}
}
cssUrlEmbed: {
encodeWithBaseDir: {
options: {
baseDir: './app'
},
files: {
'path/to/output.css': ['path/to/input.css']
}
}
}
cssUrlEmbed: {
encode: {
expand: true,
cwd: 'target/css',
src: [ '**/*.css' ],
dest: 'target/css'
}
}
cssUrlEmbed: {
encode: {
options: {
skipUrlsLargerThan: '5 MB'
},
expand: true,
cwd: 'target/css',
src: [ '**/*.css' ],
dest: 'target/css'
}
}
cssUrlEmbed: {
encode: {
options: {
useMimeTypeSniffing: false
},
expand: true,
cwd: 'target/css',
src: [ '**/*.css' ],
dest: 'target/css'
}
}
inclusive: false).exclude-me {
background-image: url('exclude_me.png'); /* noembed */
}
inclusive: true).include-me {
background-image: url('include_me.png'); /* embed */
}
.include-me1 {
background: transparent url('include_me.png') /* embed */ center center no-repeat;
}
.include-me2 {
background-image: -webkit-image-set(url('include_me1.png') /* embed */ 1x, url('include_me2.png') /* embed */ 2x);
}
inclusive option. See docs.failOnMissingUrl to false to disable this.FAQs
Embed URL's as base64 strings inside your stylesheets
The npm package grunt-css-url-embed receives a total of 296 weekly downloads. As such, grunt-css-url-embed popularity was classified as not popular.
We found that grunt-css-url-embed demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.