10 lines
243 B
TypeScript
10 lines
243 B
TypeScript
|
import { writeFileAsync } from './utils'
|
||
|
|
||
|
export async function updatePackageJson(
|
||
|
path: string,
|
||
|
partial: Record<string, any>,
|
||
|
) {
|
||
|
const old = require(path)
|
||
|
await writeFileAsync(path, JSON.stringify({ ...old, ...partial }, null, 2))
|
||
|
}
|