Write file and format it with prettier
- π Formats with prettier
- π§ Uses your projects config
- π Creates directories if needed
- π If a prettier config is not found, uses prettier defaults instead
- π« Automatically stringifies objects
import writePrettyFile from 'write-pretty-file'
await writePrettyFile('hello/world.json', { hello: 'world' })
await writePrettyFile('hello/world.ts', 'export default function (){}')
npm install write-pretty-file