Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

svg-crowbar

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svg-crowbar

A library based on a Chrome-specific bookmarklet that extracts SVG nodes and accompanying styles from an HTML document and downloads them as an SVG file

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
634
decreased by-20.25%
Maintainers
1
Weekly downloads
 
Created
Source

SVG Crowbar Library

NPM version code style: prettier

A standalone 3.5Kb JS client library based on Chrome bookmarklet.

The library provides functionality to trigger a download of a given SVG file having alle the styles inlined, to make it look the same when opened independently from the original HTML page.

It is also possible to use this library to convert an SVG to a PNG before downloading.

Usage

import downloadSvg from 'svg-crowbar';

downloadSvg(document.querySelector('svg'), 'my_svg');

or

import { downloadPng } from 'svg-crowbar';

downloadPng(document.querySelector('svg'));

Filename is determined by element id, class or page title, when not provided explicitly.

An error is thrown in case no valid SVG element was provided.

Keywords

FAQs

Package last updated on 13 Jan 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc