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

A basic guide for prioritizing features

A basic guide for prioritizing features

As product developers, we all have limited resources in terms of people and time. On the other hand, we have a lot of features to build, and we should find a good balance so that we can use our resources the best way possible. When we are in that situation (almost always) the importance of prioritization appears in our mind and we suddenly start thinking in the best way to decide what to do next. We have some tips, based…

Read More Read More