How do you get the directory of a file?


#1

Hi, How to get the directory of a file? I can get the file path but not the directory of the current file.
Is there a clean way to get it? I’m trying to avoid parsing the file path.


#2

You can use path.dirname(). I’d link you an example from one of the Atom projects but it seems GitHub is having some issues right now :frowning:


#3

Awesome! It’s working =). Thanks a lot


#4

You’re welcome. I’m glad I could help!