👆🏽 click to check the live page
This is a receipt maker. You can input info and the receipt will be generated and downloaded in pdf format.
Tech used: React, Node.js
Axios is very similar to Fetch API. It can be used to make HTTP request from node.js or XMLHttpRequests from the browser. It's a JavaScript library so we have to import it to use it. When we use fetch()
, we have to transfer the response to json first and then we can get the data we want. Using Axios, we don't have to worry about it.
Installation
$ npm install -g html-pdf
Example Code:
const pdf = require('html-pdf')
pdf.create(html, config-option).toFile('filename.pdf', callback(err,res))