Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/josnun/peedy
A simple node service for turning those websites into pdfs
https://github.com/josnun/peedy
Last synced: about 2 months ago
JSON representation
A simple node service for turning those websites into pdfs
- Host: GitHub
- URL: https://github.com/josnun/peedy
- Owner: JosNun
- License: mit
- Created: 2019-12-19T00:57:25.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T01:20:29.000Z (almost 2 years ago)
- Last Synced: 2023-03-06T03:29:56.106Z (almost 2 years ago)
- Language: TypeScript
- Size: 1.23 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![Usage Example](https://raw.githubusercontent.com/josnun/peedy/master/data/screenshots/demo.gif)
# Peedy
Peedy is a simple node project that turns a url or HTML string into a pdf document
## Installation
TODO
For now, clone and run `npm run build`
## Usage
Send a post request to the root with a url or an htmlString, and Peedy will return the generated PDF document.
```
curl \
--output example.pdf \
--request POST \
--url http://localhost:3000/ \
--header 'content-type: application/json' \
--data '{
"url": "https://josnun.com"
}'```
### Options
| Option | Description |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| url | The url that Peedy should use to generate the PDF. Takes priority over htmlString. |
| htmlString | A string of HTML to generate a PDF from. Can include CSS and JS. |
| pdfOptions | Options that get passed to puppeteer for generating the PDF. [See here for details.](https://github.com/puppeteer/puppeteer/blob/v2.0.0/docs/api.md#pagepdfoptions) |### Environment Variables
| variable | Default | Description |
| -------- | ------- | ------------------------------------- |
| PORT | 3546 | The port that 'Peedy should listen on |## Todo
- [x] Add npm command for debugging
- [ ] VSCode debugger support?
- [x] Pdf config options
- [x] Read port from env variables
- [x] Add clean command
- [x] Tests
- [ ] Better Typing
- [ ] Dockerize
- [ ] Update Readme## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
## License
[MIT](https://choosealicense.com/licenses/mit/)