
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
@parcel/transformer-svg
Advanced tools
@parcel/transformer-svg is a plugin for Parcel, a web application bundler. This transformer allows you to import SVG files and use them in your JavaScript, CSS, or HTML files. It can optimize SVG files, inline them, or convert them to React components.
Importing SVG as URL
This feature allows you to import an SVG file as a URL, which can then be used in your HTML or CSS.
import logoUrl from './logo.svg';
console.log(logoUrl);
Inlining SVG
This feature allows you to import an SVG file and inline its content directly into your HTML.
import logo from './logo.svg';
document.body.innerHTML = logo;
Converting SVG to React Component
This feature allows you to import an SVG file as a React component, which can then be used in your React application.
import { ReactComponent as Logo } from './logo.svg';
function App() {
return <Logo />;
}
SVGR is a tool that transforms SVGs into React components. It is highly customizable and can be used as a CLI tool, webpack loader, or Node.js library. Compared to @parcel/transformer-svg, SVGR is more focused on React and offers more customization options for the transformation process.
svg-url-loader is a webpack loader that loads SVG files as URLs. It can also optimize SVG files using SVGO. Compared to @parcel/transformer-svg, svg-url-loader is more focused on URL loading and optimization, and it is specifically designed for use with webpack.
react-svg-loader is a webpack loader that transforms SVGs into React components. It also optimizes SVG files using SVGO. Compared to @parcel/transformer-svg, react-svg-loader is specifically designed for React and webpack, offering a similar feature set but with a focus on React component transformation.
FAQs
Unknown package
The npm package @parcel/transformer-svg receives a total of 262,963 weekly downloads. As such, @parcel/transformer-svg popularity was classified as popular.
We found that @parcel/transformer-svg demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.