Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/excalidraw/svg-to-excalidraw
Convert SVGs into Excalidraw data
https://github.com/excalidraw/svg-to-excalidraw
Last synced: 5 days ago
JSON representation
Convert SVGs into Excalidraw data
- Host: GitHub
- URL: https://github.com/excalidraw/svg-to-excalidraw
- Owner: excalidraw
- License: mit
- Created: 2021-02-18T23:39:31.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-07T23:43:49.000Z (6 months ago)
- Last Synced: 2024-08-06T21:23:34.065Z (3 months ago)
- Language: TypeScript
- Homepage: https://codesandbox.io/s/elastic-brook-4sfvz
- Size: 762 KB
- Stars: 117
- Watchers: 8
- Forks: 22
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# svg-to-excalidraw
Library to convert SVG to Excalidraw’s file format.
## :floppy_disk: Installation
```bash
yarn add svg-to-excalidraw
```## :beginner: Usage
```typescript
import svgToEx from "svg-to-excalidraw";const heartSVG = `
`;
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
```bash
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](https://github.com/excalidraw/svg-to-excalidraw/issues) first to discuss what you would like to change.