🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

is-svg

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-svg

Check if a string is SVG

latest
Source
npmnpm
Version
6.1.0
Version published
Weekly downloads
1.7M
-36.89%
Maintainers
1
Weekly downloads
 
Created
Source

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

API

isSvg(string, options?)

options

Type: object

validate

Type: boolean
Default: true

Whether to validate the SVG as proper XML.

Turning this off can improve performance significantly.

Keywords

svg

FAQs

Package last updated on 08 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts