Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
broccoli-rsvg
Advanced tools
This Broccoli plugin renders SVG files to PNG using node-rsvg.
First, get librsvg:
brew install librsvg
pkg install graphics/librsvg2
sudo apt-get install librsvg2-dev
sudo yum install librsvg2-devel
Second, install as any other broccoli plugin:
npm install --save-dev broccoli-rsvg
var renderSvg = require('broccoli-rsvg')
var outputTree = renderSvg(inputNodes, fileOptions)
inputNodes
: A list of nodes (trees) that contain the SVG files you want to render.fileOptions
: A hash of rsvg options and alternative versions for each file; see the following example.var Rsvg = require('broccoli-rsvg')
var png = new Rsvg(['svg'], {
'logo.svg': {
width: 600,
height: 500, // optional override, values from the svg file itself are used by default
versions: [
{ // Retina version example
path: 'logo@2x.png',
width: 1200,
height: 1000
},
{ // Transformed version example
transformer: function(svg) {
return svg.replace('#000000', '#ffffff') // You can use elementtree or xmldom here...
},
path: 'logo-black.png',
versions: [
{ // Nested example: transformed + retina
path: 'logo-black@2x.png',
width: 1200,
height: 1000
}
]
}
]
}
})
return [svg, png]
Note: avoid passing broccoli-svgo output to rsvg, it might get screwed up.
Please feel free to submit pull requests!
By participating in this project you agree to follow the Contributor Code of Conduct.
This is free and unencumbered software released into the public domain.
For more information, please refer to the UNLICENSE
file or unlicense.org.
FAQs
SVG to PNG renderer for Broccoli
The npm package broccoli-rsvg receives a total of 2 weekly downloads. As such, broccoli-rsvg popularity was classified as not popular.
We found that broccoli-rsvg 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.