Nodejs filesystem
From wikinotes
Paths
const path = require('path'); const rcfile = path.resolve('foo.txt') // relative to abspath path.dirname(rcfile) // '/home/you' path.basename(rcfile) // 'foo.txt' path.extname(rcfile) // '.txt' // nodejs does not expand ~ // so replace it with the envvar '~/.zshrc'.replace('~', process.env.HOME)