This code exports two functions, chext and chroot, which manipulate file paths by changing extensions and checking/file paths. The code uses regular expressions and the path module for these functions.
Run example
npm run import -- "changing file names"
changing file names
var path = require('path')
function chext(file, ext) {
return file.replace(new RegExp('\\' + path.extname(file) + '