EN
Node.js - get file extension
0
points
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