MCPcopy Create free account
hub / github.com/angular/dev-infra / writePackageJson

Function writePackageJson

ng-dev/release/publish/test/test-utils/test-utils.ts:125–131  ·  view source on GitHub ↗
(packageName: string, version: string)

Source from the content-addressed store, hash-verified

123
124/** Writes a `package.json` for the given package name. */
125export async function writePackageJson(packageName: string, version: string) {
126 const packageOutDir = path.join(testTmpDir, 'dist', packageName);
127 const packageJsonPath = path.join(packageOutDir, 'package.json');
128
129 await fs.promises.mkdir(packageOutDir, {recursive: true});
130 await fs.promises.writeFile(packageJsonPath, JSON.stringify({version}));
131}
132
133/**
134 * Template string function that converts a changelog pattern to a regular

Callers 2

common.spec.tsFile · 0.85

Calls 1

stringifyMethod · 0.45

Tested by

no test coverage detected