nodejsHow to get current file name
Usage example
let file = __filename
console.log(file)
output
/tmp/test.js
Related
More of Nodejs
- How to get current timestamp in seconds
- How to run Node.js script in background
- How to post url-encoded data
- How to exit process with success
- How to send JSON response from HTTP server
- How to set content type in HTTP server
- How to extract filename from path
- How to send message to client from websocket server
- HTTP server example
- How to write file
See more codes...