Skip to content

Pipeline operator

Pipelines let you pass the result of an expression into another expression with multiple steps and without intermediate variables.

Type TC39 MDN CoreJS Babel Civet JS+
Syntax Stage 2 View View View via Babel
JS+ TypeScript
Object.keys(envars)
.map(envar => `${envar}=${envars[envar]}`)
.join(' ')
|> `$ ${%}`
|> chalk.dim(%, 'node', args.join(' '))
|> console.log(%)
console.log(
chalk.dim(
`$ ${Object.keys(envars)
.map(envar =>
`${envar}=${envars[envar]}`)
.join(' ')
}`,
'node',
args.join(' ')
)
);

This syntax is integrated with Babel’s plugin-proposal-pipeline-operator plugin.