papers please citation generator
Find a file
2023-02-10 18:18:30 +05:00
data cleanup / refactor 2021-03-09 17:42:18 +05:00
src fix formatting 2023-02-06 20:54:47 +05:00
.gitignore cleanup / refactor 2021-03-09 17:42:18 +05:00
index.js fix #4 2023-02-06 19:58:25 +05:00
LICENSE Update LICENSE 2023-02-10 18:03:05 +05:00
package-lock.json fix #4 2023-02-06 19:58:25 +05:00
package.json 1.3.0 2023-02-10 18:17:35 +05:00
README.md Update README.md 2023-02-10 18:18:30 +05:00

Node.js library to create papers please citations.

Installation

Needs node.js version ^19.x.x
Installing with npm npm i --save @blockzilla101/citation
Installing with yarn yarn add @blockzilla101/citation

Usage

const { Citation } = require('citation')
const citation = new Citation()
// Optional: width and height can be set in the constructor too
// new Citation(<width>, <height>)

citation.reason = 'reason'
citation.penalty = 'penalty'
citation.title = 'title'
citation.width = 450
citation.height = 200
citation.barcode = [1, 0, 1, 1, 0, 0, 0, 1] // 0 = dont put a line, 1 = put a line; expands leftwards to fit the barcode
citation.resizeReason = true // whether to truncate the reason instead of expanding to fit it

citation.render('citation.png')
// for a gif
citation.render('citation.gif', true)

render() returns the rendered image or gif as a buffer.