epic-cli
Version:
Commands useful for everyday web development with node.
11 lines (8 loc) • 389 B
text/typescript
import { readFileSync, writeFileSync } from 'node:fs'
import { join } from 'node:path'
import { formatPackageJson } from 'pakag'
const packageJsonPath = join(process.cwd(), 'package.json')
const packageContents = readFileSync(packageJsonPath, 'utf8')
const formattedContents = await formatPackageJson(packageContents)
writeFileSync(packageJsonPath, formattedContents)