nodejsHow to get current file name
Usage example
let file = __filename
console.log(file)
output
/tmp/test.js
Related
More of Nodejs
- How to send message to client from websocket server
- How to set content type in HTTP server
- How to read stream to Buffer
- How to run Node.js script in background
- How to send JSON response from HTTP server
- How to make GET request
- How to pipeline streams
- How to post url-encoded data
- How to log errors
- How to init Node.js project with NPM
See more codes...