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: 4 months 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: 2023-02-12T02:04:07.000Z (over 1 year ago)
- Last Synced: 2024-02-23T16:35:05.969Z (4 months ago)
- Language: TypeScript
- Homepage: https://codesandbox.io/s/elastic-brook-4sfvz
- Size: 706 KB
- Stars: 93
- Watchers: 7
- Forks: 19
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Lists
- awesome-stars - excalidraw/svg-to-excalidraw - Convert SVGs into Excalidraw data (TypeScript)
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.