nodejsHow to get current file name
Usage example
let file = __filename
console.log(file)
output
/tmp/test.js
Related
More of Nodejs
- How to write file
- How to read stream to Buffer
- How to set content type in HTTP server
- How to send message to client from websocket server
- How to run Node.js script in background
- How to pretty print JSON stringify
- How to pipeline streams
- How to post url-encoded data
- How to convert JSON to array
- How to run Node.js script
See more codes...