pipeline.macro

🎣 A babel macro which works similarly to the pipeline operator.

Downloads
1.5K
Stars
36
Committers
1

pipeline.macro

A babel macro which works similarly to the pipeline operator.

Usage

import pipe from 'pipeline.macro'

const doubleSay = str => str + ', ' + str
const capitalize = str => str[0].toUpperCase() + str.substring(1)
const exclaim = str => str + '!'

const result = pipe(
  'hello',
  doubleSay,
  capitalize,
  exclaim,
)

result // "Hello, hello!"