---
id: babel-plugin-proposal-pipeline-operator
title: @babel/plugin-proposal-pipeline-operator
sidebar_label: pipeline-operator
---
$ npm install --save-dev @babel/plugin-proposal-pipeline-operator
The pipeline operator has several competing proposals.
Configure which proposal to use with the required "proposal"
option.
Value | Proposal | Version added |
---|---|---|
"minimal" |
Minimal F#-style pipes | v7.0.0 |
"fsharp" |
F#-style pipes with await |
v7.5.0 |
"hack" |
Hack-style pipes | v7.15.0 |
"smart" |
Smart-mix pipes (deprecated) | v7.3.0 |
If "proposal": "hack"
is used, then a "topicToken": "%"
, "topicToken": "^"
, or "topicToken": "#"
option must also be included.
The "proposal": "smart"
option is deprecated and subject to removal in a future major version.
When TC39 accepts one of the proposals, that proposal will become the default and the "proposal"
option will no longer be required.
Original expression |
Minimal F# pipes |
F# pipes with |
Hack pipes |
---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Not supported |
|
|
|
Not supported | Not supported |
|
For minimal F# pipes:
{
"plugins": [
["@babel/plugin-proposal-pipeline-operator", { "proposal": "minimal" }]
]
}
For F# pipes with await
:
{
"plugins": [
["@babel/plugin-proposal-pipeline-operator", { "proposal": "fsharp" }]
]
}
For Hack pipes with %
topic token:
{
"plugins": [
["@babel/plugin-proposal-pipeline-operator", { "proposal": "hack", "topicToken": "%" }]
]
}
For Hack pipes with ^
topic token:
{
"plugins": [
["@babel/plugin-proposal-pipeline-operator", { "proposal": "hack", "topicToken": "^" }]
]
}
For Hack pipes with #
topic token:
{
"plugins": [
["@babel/plugin-proposal-pipeline-operator", { "proposal": "hack", "topicToken": "#" }]
]
}
Because this plugin requires a configuration option, it cannot be directly configured from the CLI. Use a config file instead with the CLI, to add and configure this plugin.
For minimal F# pipes{proposal: "minimal"}
:
require("@babel/core").transformSync("code", {
plugins: [
[ "@babel/plugin-proposal-pipeline-operator", { proposal: "minimal" } ],
],
});
For F# pipes with await
:
require("@babel/core").transformSync("code", {
plugins: [
[ "@babel/plugin-proposal-pipeline-operator", { proposal: "fsharp" } ],
],
});
For Hack pipes with %
topic token:
require("@babel/core").transformSync("code", {
plugins: [
[ "@babel/plugin-proposal-pipeline-operator", { proposal: "hack", topicToken: "%" } ],
],
});
For Hack pipes with ^
topic token:
require("@babel/core").transformSync("code", {
plugins: [
[ "@babel/plugin-proposal-pipeline-operator", { proposal: "hack", topicToken: "^" } ],
],
});
For Hack pipes with #
topic token:
require("@babel/core").transformSync("code", {
plugins: [
[ "@babel/plugin-proposal-pipeline-operator", { proposal: "hack", topicToken: "#" } ],
],
});