Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@codewithshin/svelte-heroicons

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codewithshin/svelte-heroicons

One liner:

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

How to change svg to svelte file

One liner:

cd /path/to/dir
rename -v 's/./\U$&/;s/-(.)/\U$1/g;s/\.svg$/Icon.svelte/' -- *.svg && sed -i '1s/^/<script>export let className="h-6 w-6";<\/script>/' ./*.* && sed -i 's/fill/class={className} &/' ./*.*

Details

Convert all files from academic-cap.svg to AcademicCapIcon.svelte.

cp /path/to/dir/optimized /path/to/dir/svelte
cd /path/to/dir/svelte
rename -v 's/./\U$&/;s/-(.)/\U$1/g;s/\.svg$/Icon.svelte/' -- *.svg

Insert strings at the beginning to all files.

sed -i '1s/^/<script>export let className="h-6 w-6";<\/script>/' ./*.*

Insert strings before a word

sed -i 's/fill/class={className} &/' ./*.*

Step 2

sed "s:\(.*\)\.svelte:import \1 from './heroicons/outline/&':" namesWithSvelte.txt > index3.js

This will change a file from:

AcademicCapIcon.svelte
AdjustmentsIcon.svelte
AnnotationIcon.svelte
ArchiveIcon.svelte
...

to:

import AcademicCapIcon from './dir1/dir2/AcademicCapIcon.svelte'
import AdjustmentsIcon from './dir1/dir2/AdjustmentsIcon.svelte'
import AnnotationIcon from './dir1/dir2/AnnotationIcon.svelte'
import ArchiveIcon from './dir1/dir2/ArchiveIcon.svelte'
...

FAQs

Package last updated on 09 Feb 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc