JSPM

pipeline.macro

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 251
  • Score
    100M100P100Q99404F
  • License MIT

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

Package Exports

  • pipeline.macro

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pipeline.macro) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

pipeline.macro

Babel 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!"