🚀 DAY 3 OF LAUNCH WEEK:Announcing Bun and vlt Support in Socket.Learn more →
Socket
Book a DemoInstallSign in
Socket

joto-svg

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

joto-svg

Generate SVG for joto.rocks

latest
Source
npmnpm
Version
1.3.0
Version published
Maintainers
1
Created
Source

joto-svg: generate SVGs for joto.rocks

Generate SVGs contains text, icons, charts for https://joto.rocks.

Installation

This module is meant to be used server-side, using NodeJS.

npm i joto-svg

Usage

The canvas size is 500Ă—500.

const fs = require('fs');
const JotoSVG = require('joto-svg');

const joto = new JotoSVG();

const cityName = 'Paris, France';
joto.addString({
  x: 250 - cityName.length * 6,
  y: 40,
  size: 30,
  str: cityName,
  align: 'center',
});

const svg = joto.getSVG();
fs.writeFileSync('./joto.svg', svg, { encoding: 'utf8' });

Check test.js for a more complete example. You can especially use icons from Font Awesome. Check index.js to get details about usage.

You can use joto.html to see how your svg would render on the board.

Examples

Check examples/ folder.

Acknowledgment

Code in ./joto-text comes from Joto's webapp; I made some small changes so it works in a node environment, but all credits go to Joto.

Keywords

joto

FAQs

Package last updated on 03 Oct 2020

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