nodejsHow to get current script path
Usage example
let dir = __dirname
console.log(dir)
output
/tmp
Related
More of Nodejs
- How to write file
- How to set content type in HTTP server
- How to send JSON response from HTTP server
- How to send message to client from websocket server
- How to convert JSON to array
- How to get UTC timestamp
- How to get current file name
- How to read stream to string
- How to convert unix timestamp to local date/time
- How to POST JSON data
See more codes...