nodejsHow to get current script path
Usage example
let dir = __dirname
console.log(dir)
output
/tmp
Related
More of Nodejs
- How to set content type in HTTP server
- How to set environment variable
- How to write file
- How to read stream to Buffer
- How to read stream to string
- How to post url-encoded data
- How to get UTC timestamp
- How to send message to client from websocket server
- How to run Node.js script in background
- How to get current timestamp in seconds
See more codes...