babel-plugin-improved-piped-pipelines

2.0.0 • Public • Published

babel-plugin-improved-piped-pipelines

Piggybacks on the new pipeline operator syntax to improve developer experience when using a gulp-like piping API. Mainly reduces the repetitive .pipe call and the messy closing parenthesis ))

Right now, it depends on the conflicting pipeline JavaScript feature, so I hope to repurpose the |> syntax to something else.

Example

Input

gulp.src('style.css')
  |> plumber()
  |> postcss()
  |> rename('style.min.css')
  |> gulp.dest('dist')

Output

gulp.src('style.css')
  .pipe(plumber())
  .pipe(postcss())
  .pipe(rename('style.min.css'))
  .pipe(gulp.dest('dist'))

Usage

operator options can be any of the following: ['|>', '||', '&&', '??']. the default is the pipeline operator

{
  "plugins": [
    ["babel-plugin-improved-piped-pipelines", { "operator": "|>" }]
  ]
}

Contributing

git clone https://github.com/hyperupcall/babel-improved-piped-pipelines
cd babel-plugin-improved-piped-pipelines
pnpm i -r
pnpm publish

Package Sidebar

Install

npm i babel-plugin-improved-piped-pipelines

Weekly Downloads

21

Version

2.0.0

License

MIT

Unpacked Size

5.07 kB

Total Files

4

Last publish

Collaborators

  • hyperupcall