Add option to override cwd
The current working directory (cwd) is resolved using process.cwd()
. It would be helpful for testing environments and other specialty use cases (e.g., embedded application) if this value could be overridden. If the cwd
option is specified, use it in place of the process.cwd()
.
const expandPath = require('@antora/expand-path-helper')
expandPath('~+', { cwd: '/path/to/cwd' })
// => /path/to/cwd