How do you get the directory of a file?


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.


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:


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


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