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 pipeline streams
- How to read stream to Buffer
- How to run Node.js script
- How to read stream to string
- How to POST JSON data
- How to send JSON response from HTTP server
- How to get format date in "yyyy-mm-dd"
- How to check if Node.js is installed or not
See more codes...