
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
This package contains the core, CLI, and Vite functionalities for svg2ember.
To use svg2ember in your project (for example, if you want to use its Vite plugin or programmatically access its core functions):
pnpm add --save-dev svg2ember
# or
npm install --save-dev svg2ember
If you want to use the CLI tool globally:
pnpm add --global svg2ember
# or
npm install --global svg2ember
Once installed globally, you can use the svg2ember command:
svg2ember input.svg output.gjs
# Create TypeScript component
svg2ember --typescript input.svg output.gts
# Process all SVGs in the 'icons/' directory and output them to 'components/icons'
svg2ember --out-dir components/icons icons/
You can also run it without global installation using pnpx:
pnpx svg2ember input.svg output.gjs
For more CLI options, run:
svg2ember --help
# or
pnpx svg2ember --help
Configure the Vite plugin to enable SVG component imports:
// vite.config.js
import svg2ember from "svg2ember/vite";
export default {
plugins: [
svg2ember(),
// other Ember plugins...
],
};
Then use in Ember components:
import Butterfly from '../icons/butterfly.svg?component';
import butterflyUrl from '../icons/butterfly.svg'; // standard imports unaffected
<template>
<h1>A butterfly (component):</h1>
<Butterfly class='h-6 w-6' data-my-icon />
<h1>A butterfly (image):</h1>
<img src={{butterflyUrl}} alt='butterfly' />
</template>
The class and data-my-icon attributes are passed through to the root <svg> element via ...attributes.
The component also works using block syntax and allows arbitrary SVG elements as children as long as they are valid children of the <svg> element. The {{yield}} is at the bottom, so the children will be placed below any other content in the SVG. (Keep in mind the coordinate space is determined by the viewBox.)
import Butterfly from '../icons/butterfly.svg?component';
<template>
<Butterfly class='h-6 w-6'>
{{! fade the icon in and out using SVG animate }}
<animate
attributeName="opacity"
values="0;1;0"
dur="500ms"
repeatCount="indefinite"
/>
</Butterfly>
</template>
Issues and PRs always welcome.
MIT
FAQs
Transform SVGs into Ember components.
The npm package svg2ember receives a total of 42 weekly downloads. As such, svg2ember popularity was classified as not popular.
We found that svg2ember 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.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.