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 send message to client from websocket server
- How to read stream to Buffer
- How to get current date and time
- How to make GET request
- How to pipeline streams
- How to get difference between 2 dates in days
- How to get client IP in websocket server
- How to run Node.js script in background
- How to set environment variable
See more codes...