Marcus is a fullstack JS developer. He’s passionate about the hapi framework for Node.js and loves to build web apps and APIs. Creator of Futureflix and the “learn hapi” learning path.

Node.js — Detect if Running on Linux

In some situations, you need to detect the operating system running the Node.js process. You can do that by using Node.js’ built-in os module. {{outline}} Check if the Operating System is Linux The os module in Node.js provides a platform method. This platform method allows you to …

Continue Reading

Node.js — Get a File‘s Extension

In some situations, you may need to retrieve the extension of a file on your local disk. Node.js comes with built-in functionality that you can use in your application. This tutorial shows you how to retrieve the file extension in Node.js. {{outline}} Retrieve the File Extension Node.js’ …

Continue Reading

Node.js — Get the Size of a File

Node.js ships with the native fs module to interact with the local file system. The fs module supports retrieving statistics for a file on your local disk. You may also get the size of a file from these statistics. This tutorial shows you how to retrieve the file size …

Continue Reading

Node.js — How to Download a File

You can download a file in Node.js in different ways. Node.js comes with built-in functions to download and save a file to your local disk. You can combine the integrated https and fs modules to download files from the Internet. This tutorial shows you how to use native …

Continue Reading

Explore the Library

Find interesting tutorials and solutions for your problems.