npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

svg-to-swiftui-core

v0.3.5

Published

SVG to SwiftUI Shape converter core package. Will transform the raw SVG code into SwiftUI Shape via the JavaScript API.

Downloads

42

Readme

SVG to SwiftUI Converter Core

Build Version Downloads/month License

This is the core transpiler code that you can use to convert raw SVG code into SwiftUI Shape struct that you can use directly in your SwiftUI Project.

Before we start

This package is written for JavaScript projects, so it's only meant to be used in a Node.js projects. If you just need to convert an SVG to SwiftUI Shape you should use this tool.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Installing

All you need to do is to add this package to your project using following command:

npm i svg-to-swiftui-core

and then import into your project (ES6):

import { convert } from 'svg-to-swiftui-core'

Running the tests

You can run the tests by running following command:

npm test

Roadmap

  • [x] SVG <path> element
    • [ ] Line commands
      • [x] M
      • [ ] m
      • [x] L
      • [ ] l
      • [x] H
      • [ ] h
      • [x] V
      • [ ] v
      • [x] Z
      • [ ] z
    • [ ] Curve commands
      • [ ] C
      • [ ] c
      • [ ] S
      • [ ] s
      • [ ] Q
      • [ ] q
      • [ ] T
      • [ ] t
      • [ ] A
      • [ ] a
  • [x] SVG <circle> element
  • [x] SVG <rect> element
  • [x] SVG <ellipse> element
  • [ ] Fill/stroke styling with colours
  • [ ] SVG <text> element
  • [ ] SVG <g> element with autmatic grouping into sub-paths in SwiftUI
  • [ ] SVG <polygon> element
  • [ ] SVG <polyline> element
  • [ ] AVG <arc> element
  • [ ] Automatic animation support

Built With

This project relies on following npm packages:

  • svg-parser - Parses raw SVG into a HAST (Hypertext Abstract Syntaxt Tree).
  • svg-pathdata - Parses svg path d attribute into a list of easily interpretable objects.

Contributing

Feel free to open an issue if your SVG file doesn't work or send a PR with our suggested changes!

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details