With this tutorial you can create a NodeJS Application CLI which calculates how long the 'require' function takes for each module.
The ⏳Startup Time for an HTTP Server or CLI Apps is super important. The time it takes for the Nodejs application to be up and running will also depends on the time it takes to import the modules that the application requires.
The Performance Timing API provides an implementation of the W3C Performance Timeline specification. The purpose of the API is to support the collection of high resolution performance metrics.
Official Documentation: NodeJS | Performance Timing API
The following video shows how you can get the time that the require function need for each module.
You can run this project in Gitpod, a one-click online IDE for GitHub:
List of methodologies and tools used in this project for compliance with Quality Assurance Code (QAC)
- ESTlint, tool for identifying and reporting on patterns found in ECMAScript/JavaScript code.
NPM ESLint
NPM ESLint | Airbnb
In order to work with this project, your local environment must have at least the following versions:
- NodeJS Version: 13.xx
- NPM Version: 6.12.0
You have to do the following steps to be able to work with this project.
To work with this project locally it is necessary to install the NPM dependencies.
# Install npm dependencies
$npm i
# Run Application
$npm run start
/
├── assets 🌈 # Images Sources.
├── src 📦 # Main App with forks process.
| ├── subprocess # Process to launch by "fork" and calculate times..
| └── ...
└── ...
For review and update all npm dependencies of this project you need install in global npm package "npm-check-updates" npm module.
# Install and Run
$npm i -g npm-check-updates
$ncu
Created with JavaScript, lot of ❤️ and a few ☕️