Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

271
Views
Use JavaScript para convertir svg-string a base64 para el uso de css (nodo y navegador)

Tengo la siguiente cadena svg:

 const svgString = `<svg height="210" width="400"><path d="M150 0 L75 200 L225 200 Z"/></svg>`

Me gustaría convertir esta cadena

 const convertedSvgString = convertSvgString(svgString)

entonces puedo usarlo con css mask-image

 mask-image: url(`data:image/svg+xml;base64,${convertedSvgString}`)

¿Cómo defino convertSvgString para que funcione en un entorno de nodo, así como en cualquier navegador moderno?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!