Skip to content

sajmoni/write-pretty-file

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

write-pretty-file

Write file and format it with prettier

✨ Features

  • πŸ’… 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

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

About

πŸ’… Write file and format it with prettier

Resources

License

Stars

Watchers

Forks