write-pretty-file
v0.2.0
Published
Write file and automatically format it with your projects prettier config
Downloads
4
Readme
write-pretty-file
Write file and format it with prettier
✨ Features
- :nail_care: Formats with prettier
- :wrench: Uses your projects config
- :file_folder: Creates directories if needed
- :clipboard: If a prettier config is not found, uses prettier defaults instead
- :mailbox: Automatically stringifies objects
Usage
import writePrettyFile from 'write-pretty-file'
await writePrettyFile('hello/world.json', { hello: 'world' })
await writePrettyFile('hello/world.ts', 'export default function (){}')
📦 Install
npm install write-pretty-file