You've already forked wakapi-readme-stats
12 lines
531 B
JavaScript
Executable File
12 lines
531 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
// Render a Vega specification to PDF, using node canvas
|
|
const {createWriteStream} = require('fs'),
|
|
render = require('../src/render');
|
|
|
|
render('pdf', function(canvas, arg) {
|
|
const file = arg._[1] || null,
|
|
config = arg.test ? {creationDate: new Date(2012, 0, 1)} : undefined,
|
|
out = file ? createWriteStream(file) : process.stdout,
|
|
stream = canvas.createPDFStream(config);
|
|
stream.on('data', chunk => { out.write(chunk); });
|
|
}, {type: 'pdf', context: {textDrawingMode: 'glyph'}}); |