nodejsHow to get current file name
Usage example
let file = __filename
console.log(file)
output
/tmp/test.js
Related
More of Nodejs
- How to add minutes to date/time
- How to set content type in HTTP server
- How to POST JSON data
- How to send message to client from websocket server
- How to pipeline streams
- How to write file
- How to read stream to Buffer
- How to post url-encoded data
- How to init Node.js project with NPM
- How to install Node.js on Ubuntu 22.04
See more codes...