Write a package.json file for a directory, creating any missing parent directories first. Parses and
re-serializes with a plain 2-space indent regardless of how fields was built, so callers never need to worry
about matching JSON formatting by hand.
Parameters
dirPath: string
The directory to write the package.json file into.
Write a package.json file for a directory, creating any missing parent directories first. Parses and re-serializes with a plain 2-space indent regardless of how
fieldswas built, so callers never need to worry about matching JSON formatting by hand.