Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

is-svg

sindresorhus6.9mMIT5.1.0TypeScript support: included

Check if a string is SVG

svg, vector, graphics, image, picture, type, detect, check, is, string

readme

is-svg

Check if a string is SVG

Install

npm install is-svg

Usage

import isSvg from 'is-svg';

isSvg('<svg xmlns="http://www.w3.org/2000/svg"><path fill="#00CD9F"/></svg>');
//=> true