0.4.0 • Published 4 months ago

@walshhub/svg-to-excalidraw v0.4.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

svg-to-excalidraw

Library to convert SVG to Excalidraw’s file format.

:floppy_disk: Installation

yarn add svg-to-excalidraw

:beginner: Usage

import svgToEx from "svg-to-excalidraw";

const heartSVG = `
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
  <path d="M 10,30
           A 20,20 0,0,1 50,30
           A 20,20 0,0,1 90,30
           Q 90,60 50,90
           Q 10,60 10,30 z"/>
</svg>
`;

const { hasErrors, errors, content } = svgToEx.convert(heartSVG);

// SVG parsing errors are propagated through.
if (hasErrors) {
  console.error(errors);
  return;
}

navigator.clipboard.writeText(content);

// the heart excalidraw json is now copied to your clipboard.
// Just Paste it into your Excalidraw session!

:game_die: Running tests

TODO.

:building_construction: Local Development

Building the Project

yarn build

# Build and watch whenever a file is updated
yarn build:watch

:busts_in_silhouette: Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

0.3.0

4 months ago

0.4.0

4 months ago

0.2.0

5 months ago

0.1.0

8 months ago

0.0.5

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago