babel-plugin-syntax-improved-piped-pipelines-operator

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-syntax-improved-piped-pipelines-operator

Weekly Downloads

1

Version

2.0.0

License

MIT

Unpacked Size

3.74 kB

Total Files

4

Last publish

Collaborators

  • hyperupcall