nodejsHow to get current file name
Usage example
let file = __filename
console.log(file)
output
/tmp/test.js
Related
More of Nodejs
- How to read stream to Buffer
- How to post url-encoded data
- How to set content type in HTTP server
- How to send message to client from websocket server
- How to get current time
- How to get format date in "yyyy-mm-dd"
- How to read file
- How to check if Node.js is installed or not
- How to set response header in HTTP server
- How to make POST request
See more codes...