Categories
JavaScript Answers

How to get full file path in Node.js?

Spread the love

To get full file path in Node.js, we use the path.resolve method.

For instance, we write

const path = require("path");
const absolutePath = path.resolve("./Uploads/MyFile.csv");

to call path.resolve with a relative path to return the corresponding absolute path.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published.