Render VexTab to SVG in a Node environment
npm i @folkdb/vextab-render-svg
This package is released as an ES module only. Minimum Node.js version is 12 (latest LTS as of release date). CommonJS require()
is not supported.
import vextabRenderSvg from '@folkdb/vextab-render-svg'
(async () => {
const svg = await vextabRenderSvg(`
tabstave notation=true key=A time=4/4
notes :q =|: (5/2.5/3.7/4) :8 7-5/3 5h6-7/5 ^3^ :q 7V/4
`);
// do something with SVG
})();
The module's default export is a function with the following parameters:
function(content: string, {
width = 640,
offset = [0, 0],
...options
} = {}): string
- content: the VexTab string to be rendered to SVG
- width: set the width of the stave in pixels
- offset: set the
[x, y]
offset of the stave from the upper-left corner of the canvas - options: additional options passed to the VexTab's
Artist
constructor