Node
Find the Newest File in …
There are times you might need to find the latest file in a given directory. This method is not the most efficient and will have some performance costs (👀 synchronous processing 👀). Almost every time I reach for something like this it is for a utility function, like ‘find the latest database …
Assigning a Random Port …
Sometimes you want to randomly assign a port to a NodeJS/Express process instead of a hardcoded port. To randomly assign a port in Node simply listen on port '0'. const express = require('express'); const app = express(); // Listen on random port ------ const server = app.listen(0, ()=>{ …
Hosting Your Single Page …
Client side applications are extremely popular and powerful, taking advantage of all the processing power available to the browser. Single Page Applications (SPA) built using frameworks and libraries like Angular, React, and Vue have changed a lot about how we think about developing an immersive …