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 🙏

© 2026 – Pkg Stats / Ryan Hefner

transform-svg-to-native

v0.1.6

Published

A tool to convert SVGs to react-native-svg compatible SVGs.

Readme

transform-svg-to-native

All Contributors

A tool to convert SVGs to react-native-svg compatible SVGs.

Installation

npm i transform-svg-to-native

Usage

It takes a basic svg and returns a code that can be used with react-native-svg

import convertSvgString from "transform-svg-to-native"

const svg = `
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18">
    <path fill="#1FC055" fill-rule="evenodd" d="M12.648 11.583c.382-.202.778-.253 1.018-.107.363.223 3.417 2.255 3.674 2.435.258.18.382.694.028 1.199-.352.504-1.977 2.497-2.665 2.477-.69-.023-3.557-.086-8.962-5.493C.336 6.688.272 3.821.251 3.132.227 2.442 2.22.817 2.725.465c.505-.352 1.02-.22 1.2.028.203.282 2.211 3.326 2.432 3.675.152.239.096.636-.106 1.019-.2.383-1.037 1.845-1.037 1.845s.59 1.007 2.585 3.002c1.997 1.996 3.003 2.587 3.003 2.587s1.462-.837 1.845-1.038z"/>
</svg>
`

convertSvgString(svg, (code) => {
  console.log(code)
})

will generate code like

import { Svg, Path } from "react-native-svg";

export default function() {
  return (
    <Svg width={18} height={18} viewBox="0 0 18 18">
      <Path
        fill="#1FC055"
        fillRule="evenodd"
        d="M12.648 11.583c.382-.202.778-.253 1.018-.107.363.223 3.417 2.255 3.674 2.435.258.18.382.694.028 1.199-.352.504-1.977 2.497-2.665 2.477-.69-.023-3.557-.086-8.962-5.493C.336 6.688.272 3.821.251 3.132.227 2.442 2.22.817 2.725.465c.505-.352 1.02-.22 1.2.028a294.69 294.69 0 0 1 2.432 3.675c.152.239.096.636-.106 1.019-.2.383-1.037 1.845-1.037 1.845s.59 1.007 2.585 3.002c1.997 1.996 3.003 2.587 3.003 2.587s1.462-.837 1.845-1.038z"
      />
    </Svg>
  );
}

CLI

svg-to-native 'svgs/*.svg'

Commands

  --out   Specify the output folder.Defaults: `out`
  --ext   Specify the extension of output javascript files. 

License

MIT © Ritesh Kumar

Contributors

Thanks goes to these wonderful people (emoji key):

| Ritesh Kumar💻 | | :---: |

This project follows the all-contributors specification. Contributions of any kind welcome!