write-pretty-file
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i write-pretty-file

Weekly Downloads

0

Version

0.2.0

License

MIT

Unpacked Size

3.35 kB

Total Files

5

Last publish

Collaborators

  • sajmoni