Skip to content

listWorkspacePackagesSync

listWorkspacePackagesSync(repoRoot, options?): WorkspacePackageEntry[]

Defined in: list-workspace-packages.ts:55

Every package directly under the workspace roots of repoRoot that has a readable package.json holding a JSON object — roots in the order given, packages within a root sorted by directory name. A missing root, and a directory without a usable manifest, contribute nothing.

Nothing is filtered by name, version or private: that is the caller’s call (publishing wants public packages, version bumping wants all of them). repoRoot is resolved against the working directory, so dir is always absolute. A root that is absolute or climbs out of repoRoot throws a TypeError, and so does any listing error other than “not there” (ENOENT/ENOTDIR). A single-package repo has no roots; read its root manifest with readPackageJson instead.

string

ListWorkspacePackagesOptions = {}

WorkspacePackageEntry[]

import { listWorkspacePackagesSync } from "@theholocron/pkg-utils";
const publishable = listWorkspacePackagesSync(repoRoot).filter((p) => !p.manifest.private && p.name);