![]() ![]() ![]() Creating a PDF file of that HTML file generated using Google puppeteer.Learning about writing a file using fs.writeFileSync.Learning about deleting a file by using fs.unlinkSync.Learning about checking if a file exists or not using fs.statSync. ![]() Creating an HTML table with a little bit of styling with generated data in it, using an automated node script.Generating stub data (for invoices) using an online tool.So to again give a brief overview, things we will cover: In the process we’ll learn about puppeteer.launch() and understand a bit about page() & pdf(). We’ll look at how to generate a nice PDF file based on our generated HTML table file. You can even do form submissions via your NodeJS server.Īgain puppeteer is a huge tool, so we will cover just a small but a very cool feature of puppeteer. Like getting a website’s screenshots, crawling websites, and generating pre-render content for single page applications. So it’s basically a tool that lets you do all the cool browser related things on server. It can also be configured to use full (non-headless) Chrome or Chromium. So what is puppeteer? Well as per the docs, they say: Puppeteer is a Node library which provides a high-level API to control headless Chrome or Chromium over the DevTools Protocol. Writing data to a file: fs.writeFileSyncĪnother thing we will cover in this article is Google Puppeteer which is this really cool, slick tool created by some awesome folks at Google.In this article, however I will only discuss 3: Now file system is a humongous utility in NodeJS that has a lot of fancy features. Which is just a fancy way of saying that file system is a way in Node to interact with files for both read and write operations. Today I wanted to uncover the power of Node’s built-in utility tool called fs ( file system)Īs per the fs docs: The fs module provides an API for interacting with the file system in a manner closely modeled around standard POSIX functions. Node is a very powerful language and it can do a lot of things. Understanding NodeJS internally can be a little bit daunting (I know it was for me once). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |