citation/index.js
Blockzilla101 2706376849 Revert "use imports instead"
This reverts commit bac181b0fc.
2021-12-26 10:34:53 +05:00

16 lines
618 B
JavaScript

const { Citation } = require('./src/citation')
const { registerFont } = require('canvas')
const path = require('path')
const fs = require('fs')
const dataDir = path.join(__dirname, 'data')
const fontFile = path.join(dataDir, 'BMmini.ttf')
const logo = path.join(dataDir, 'logo.png')
if (!fs.existsSync(dataDir)) throw new Error(`${dataDir} is no where to be found`)
if (!fs.existsSync(fontFile)) throw new Error(`Font ${fontFile} is no where to be found`)
if (!fs.existsSync(logo)) throw new Error(`Logo ${logo} is no where to be found`)
registerFont(fontFile, { family: 'BMmini' });
module.exports = { Citation }