Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
svg-outline-stroke
Advanced tools
Readme
Sometimes you need an svg
image that have stroke
d attributes in its
paths
but outlined like after applying Outline Stroke in Adobe Illustrator or Convert to Outlines in SketchApp
yarn add svg-outline-stroke
String
input:
const outlineStroke = require('svg-outline-stroke')
const strokedSVG = `
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
<line x1="32" y1="16" x2="32" y2="48" fill="none" stroke="#202020" stroke-miterlimit="10" stroke-width="2"/>
<line x1="48" y1="32" x2="16" y2="32" fill="none" stroke="#202020" stroke-miterlimit="10" stroke-width="2"/>
</svg>`
outlineStroke(strokedSVG).then(outlined => {
console.log(outlined)
})
Buffer
input:
const fs = require('fs')
const outlineStroke = require('svg-outline-stroke')
fs.readFile('./source.svg', (err, data) => {
if (err) throw err
outlineStroke(data).then(outlined => {
fs.writeFile('./dest.svg', outlined, err => {
if (err) throw err
console.log('yup, outlined!')
})
})
})
The second argument accepts params
to apply directly when re-tracing the image, like fill
color of the path
, background
and so on. Take a look into potrace params
outlineStroke(strokedSVG, { color: '#bada55' }).then(outlined => {
console.log(outlined, 'Outlined SVG with #bada55 `fill` color')
})
micro-outline-stroke Microservice with a public endpoint
outline-stroke-cli CLI version
FAQs
Transfrom svg strokes into filled paths
The npm package svg-outline-stroke receives a total of 46 weekly downloads. As such, svg-outline-stroke popularity was classified as not popular.
We found that svg-outline-stroke demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.