Languages
[Edit]
EN

TypeScript / Node.js - get current directory

6 points
Created by:
Rian-Whitehouse
469

In this article, we would like to show you how to get the current directory in Node.js.

As current directory we can understand:

current working directory

It is context directory where script is currently run. That directory can be used to read input data and save current work results. As example we can use ls -al command result, that lists files in the current working directory, even ls is installed in other directory.

Quick solution:

current script directory

It is directory where script is located.

Quick solution:

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
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