node.js name of file code example
Example 1: node js get file name without extension
filename.split('.').slice(0, -1).join('.')
Example 2: node.js name of file
var path = require('path');
var scriptName = path.basename(__filename);
filename.split('.').slice(0, -1).join('.')
var path = require('path');
var scriptName = path.basename(__filename);