Process

process.cwd()

Returns the working directory of the process, not the directory of the current module. Relative file paths normally resolve against this directory. The fixture checks its own directory without exposing a host path. Tested on Node.js 22.16.0. Example output (one line per entry): ["true"].

Formal Syntax & Structure

nodejs syntaxnodejs
process.cwd()

Return Value

string

Current working directory.

Working Example

Example Snippetnodejs
import { isAbsolute } from 'node:path';console.log(isAbsolute(process.cwd()));
Node.js Reference