Skip to content

readPackageJsonSync

Reads the package.json file from the specified folder or from the root if no folder is specified.

Import:

import { readPackageJsonSync } from '@mnaoumov/typescript-dev-toolkit/npm';

Signature:

function readPackageJsonSync(cwd: string | undefined): PackageJson

Parameters:

Parameter Type Description
cwd string | undefined The current working folder where package.json is located.

Returns: PackageJson — The parsed PackageJson object.