Browsed by
Tag: nodejs

Turn HTML into PDF with Node.js

Turn HTML into PDF with Node.js

As the title says, today’s post is about how to generate a PDF file based on HTML content, all in Node.js. To generate PDF files for reports or downloadable content is very common in a certain type of applications where those documents play the role of reports or receipts for a transaction. Unfortunately, while some documents are basically plain text, others require a more complex structure to display all that data. If that’s the case, you can get help with…

Read More Read More

How to replace content in static files with Node.js

How to replace content in static files with Node.js

Sometimes we have HTML files with content that depends on the environment or a variable in order to render specific content and send it to the browser. A natural way to handle this type of use cases is by using a server-side rendering library like handlebars or pug. Unfortunately, to include these libraries is not always possible or we don’t want to set up the project to support them. If that’s the case (as it was for us) you’ll find…

Read More Read More

Add documentation to your API in Node.js

Add documentation to your API in Node.js

These days, document your API is a great idea if you: Work with separated teams for backend and frontend development, Have a public API, Are going to hand off the project and others need to work on it without your help In case you are working with Node.js, we like to use the solution offered by apidoc https://www.npmjs.com/package/apidoc The documentation generated by this package is not automatic so that you’ll have to describe your API resources. This may look like a…

Read More Read More

Beautify your code… with code!

Beautify your code… with code!

Automatization is an important area of software development. As developers, we should always look for ways to be more productive and do more with less. These days, here at Regos, we are investing some time in code generation and tasks automatization. Thanks to those tasks we found this nice npm package: https://www.npmjs.com/package/js-beautify The basic idea is to generate the code however you want and just format the generated files with this package. Here is an example of the basic usage. To be…

Read More Read More

Essential libraries for your Node.js project

Essential libraries for your Node.js project

Like many other developers, every time I start a new project some libraries pop up in my mind. Some of those libraries might not be needed right now, but the experience tells me that I’ll need them in the near future and I’ve learned that it’s better to complete a good enough set up and be prepared for growth instead of wait for the moment and have race against the time. Today I’ll share of the libraries that are always…

Read More Read More