Languages
[Edit]
EN

Node.js - get file extension

0 points
Created by:
Dirask Admin - Marwin
1430

In this article, we would like to show you how to get file extensions from the path in Node.js.

Quick solution: 

const path = require('path');

const fileExtension = path.extname('/path/to/file.json');
console.log(fileExtension); // .json
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join