Determine command line working directory when running node bin script

后端 未结 5 584
旧时难觅i
旧时难觅i 2020-12-22 20:34

I am creating a node command line interface. It is installed globally and uses a bin file to execute.

I plan to have a command window open at the root directory of t

5条回答
  •  醉话见心
    2020-12-22 20:54

    path.resolve('.') is also a reliable and clean option, because we almost always require('path'). It will give you absolute path of the directory from where it is called.

提交回复
热议问题