node .js how to get file name code example Example: get file name nodejs var path = require('path'); var scriptName = path.basename(__filename);