is-svg
Check if a string is SVG
Last updated a year ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install is-svg 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 6.1.0                                ...           latest (a year ago)

26 Versions

  • 6.1.0                                ...           a year ago
  • 6.0.0                                ...           2 years ago
  • 5.1.0                                ...           2 years ago
  • 5.0.1                                ...           3 years ago
  • 5.0.0                                ...           4 years ago
  • 4.4.0                                ...           4 years ago
  • 4.3.2                                ...           5 years ago
  • 4.3.1                                ...           6 years ago
  • 4.3.0                                ...           6 years ago
  • 4.2.2                                ...           6 years ago
  • 4.2.1                                ...           7 years ago
  • 4.2.0                                ...           7 years ago
  • 4.1.0                                ...           8 years ago
  • 4.0.0                                ...           8 years ago
  • 3.0.0                                ...           9 years ago
  • 2.1.0                                ...           10 years ago
  • 2.0.1                                ...           11 years ago
  • 2.0.0                                ...           11 years ago
  • 1.1.1                                ...           12 years ago
  • 1.1.0                                ...           12 years ago
  • 1.0.2                                ...           12 years ago
  • 1.0.1                                ...           12 years ago
  • 1.0.0                                ...           12 years ago
  • 0.1.2                                ...           13 years ago
  • 0.1.1                                ...           13 years ago
  • 0.1.0                                ...           13 years ago
Maintainers (1)
Downloads
Total 126
Today 0
This Week 10
This Month 36
Last Day 0
Last Week 14
Last Month 55
Dependencies (1)
Dev Dependencies (5)

© 2010 - cnpmjs.org x YWFE | Home | YWFE