🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

draw-svg-path

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

draw-svg-path

draw svg paths onto canvas contexts

latest
Source
npmnpm
Version
2.0.1
Version published
Weekly downloads
1M
2.04%
Maintainers
1
Weekly downloads
 
Created
Source

draw-svg-path

draw svg paths onto canvas contexts

install

$ npm install michaelrhodes/draw-svg-path#2.0.1

use

var draw = require('draw-svg-path')
var parse = require('parse-svg-path')

var canvas = document.createElement('canvas')
var ctx = canvas.getContext('2d')

ctx.beginPath()
ctx.lineWidth = 1
ctx.strokeStyle = '#000000'
ctx.fillStyle = 'transparent'

// Accepts /^(un)?parsed$/ paths
draw(ctx, parse('M20 20 L25 25'))
draw(ctx, 'M10 10 L15 15')

ctx.stroke()
ctx.closePath()

document.body.appendChild(canvas)

obey

MIT

Keywords

svg

FAQs

Package last updated on 26 Jan 2018

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