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 'obsidian-dev-utils/script-utils/npm';

Signature:

function readPackageJsonSync(cwd: string | undefined): PackageJson

Parameters:

ParameterTypeDescription
cwdstring | undefinedThe current working folder where package.json is located.

Returns: PackageJson — The parsed PackageJson object.