nodejsHow to get current file name
Usage example
let file = __filename
console.log(file)
output
/tmp/test.js
Related
More of Nodejs
- How to set content type in HTTP server
- How to send message to client from websocket server
- How to write file
- How to read stream to Buffer
- How to get format date in "yyyy-mm-dd"
- How to check Node.js version
- How to run Node.js script
- How to send JSON response from HTTP server
- How to export class
- How to read stream to string
See more codes...