Answers for "nodejs path"

1

nodejs path

The path module provides utilities for working with file and directory paths. It can be accessed using:

const path = require('path');
Posted by: Guest on March-10-2021
1

nodejs path

const path = require('path');

path.parse('/home/user/dir/file.txt');
// Returns:
// { root: '/',
//   dir: '/home/user/dir',
//   base: 'file.txt',
//   ext: '.txt',
//   name: 'file' }
Posted by: Guest on July-19-2021
1

node.js name of file

var path = require('path');
var scriptName = path.basename(__filename);
Posted by: Guest on November-10-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language