https://github.com/blockzilla101/citation
papers please citation generator
https://github.com/blockzilla101/citation
javascript papers-please
Last synced: 12 months ago
JSON representation
papers please citation generator
- Host: GitHub
- URL: https://github.com/blockzilla101/citation
- Owner: Blockzilla101
- License: gpl-3.0
- Created: 2020-08-14T16:23:03.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-10T13:18:30.000Z (over 3 years ago)
- Last Synced: 2024-11-19T00:46:39.708Z (over 1 year ago)
- Topics: javascript, papers-please
- Language: JavaScript
- Homepage:
- Size: 400 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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
```js
const { Citation } = require('citation')
const citation = new Citation()
// Optional: width and height can be set in the constructor too
// new Citation(, )
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.