Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including gulp-nf-prettier with all npm packages installed. Try it out:

require("prettier/package.json"); // prettier is a peer dependency. var gulpNfPrettier = require("gulp-nf-prettier")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

gulp-nf-prettier v3.0.0

Create vinyl streams to pipe to prettier

gulp-nf-prettier

A Gulp plugin to run Prettier on your code base.

nf?

Stands for the Netflix fork of gulp-pretter. We had certain requirements for the plugin so we forked it for ourselves.

Peer Dependency

Prettier is a peer dependency of gulp-nf-prettier. That means you can upgrade Prettier independent of this plugin since the API shouldn't change too much. This also means that you should use their docs to see how to utilize the library.

check

This plugin has the ability to be run in a CI environment. Pass the check flag in the options and if any file hasn't been run through prettier with your options it will error, letting you fail your build.

Example usage

gulp
  .src(glob, { base: './' })
  .pipe(prettier({
    printWidth: 120,
    tabWidth: 2,
    parser: 'flow',
    singleQuote: true,
    trailingComma: 'es5',
    bracketSpacing: true,
    jsxBracketSameLine: true,
    check: true
  })

Credit

Forked from Bhargav Patel. Credit to him to getting the ball rolling. Credit to the Gulp team. Consider donating to them. Credit to James Long for an amazing library. Hire him for contract work.

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free