@eklingen/vinyl-stream-prettier

1.0.2 • Public • Published

Small vinyl-stream wrapper -aka Gulp plugin- for prettier

Run prettier within your streams. Supports automatic fixing of files. Also has a fast method for more speed, and a slow method for more control.

NOTE: No tests have been written yet!

Installation

yarn install. Or npm install. Or just copy the files to your own project.

Usage

const prettierWrapper = require("@eklingen/vinyl-stream-prettier");
stream.pipe(prettierWrapper());

This package assumes a configuration dotfile where prettier can find it.

Options

You have the following options:

failAfterError

This will determine wether to fail or not. Useful in a pre-commit hook, for example.

prettierWrapper({
  failAfterError: true,
});

prettier

These options are passed verbatim to prettier. See the "prettier" documentation for more details.

prettierWrapper({
  prettier: {
    fix: false,
  },
});

Dependencies

This package requires "prettier".


Copyright (c) 2023 Elco Klingen. MIT License.

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @eklingen/vinyl-stream-prettier

    Weekly Downloads

    45

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    5.2 kB

    Total Files

    5

    Last publish

    Collaborators

    • eklingen