MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / writeDefaultPackageJson

Function writeDefaultPackageJson

packages/cli/src/commands/init.ts:235–253  ·  view source on GitHub ↗
(destDir: string, projectName: string)

Source from the content-addressed store, hash-verified

233}
234
235function writeDefaultPackageJson(destDir: string, projectName: string): void {
236 const packageJsonPath = resolve(destDir, "package.json");
237 if (existsSync(packageJsonPath)) return;
238
239 writeFileSync(
240 packageJsonPath,
241 `${JSON.stringify(
242 {
243 name: toPackageName(projectName),
244 private: true,
245 type: "module",
246 scripts: buildPackageScripts(),
247 },
248 null,
249 2,
250 )}\n`,
251 "utf-8",
252 );
253}
254
255function listHtmlFiles(dir: string): string[] {
256 const files: string[] = [];

Callers 1

scaffoldProjectFunction · 0.85

Calls 3

resolveFunction · 0.85
toPackageNameFunction · 0.85
buildPackageScriptsFunction · 0.85

Tested by

no test coverage detected