Skip to content

svgToBlob

Convert SVG string to Blob.

Usage

js
import { svgToBlob } from 'js-cool'

Signature

typescript
function svgToBlob(svg: string): Blob

Parameters

ParameterTypeDescription
svgstringSVG string

Returns

Blob - Blob with SVG MIME type.

Examples

js
const svg = '<svg>...</svg>'
const blob = svgToBlob(svg)
// Blob { type: 'image/svg+xml' }

Released under the MIT License.