JSPM

write-pretty-file

0.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 18
  • Score
    100M100P100Q60213F
  • License MIT

Write file and automatically format it with your projects prettier config

Package Exports

  • write-pretty-file
  • write-pretty-file/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (write-pretty-file) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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