You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/cli/install/README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
# Installing the CLI
2
2
3
+
<VideoPlayersrc="https://www.youtube.com/embed/CelgPjcB2nU"title="Installing the CLI"/>
4
+
3
5
[[toc]]
4
6
5
7
## macOS
@@ -42,8 +44,8 @@ Download the appropriate [Linux CLI build](#cli-builds) for your architecture. U
42
44
43
45
Pipedream publishes the following builds of the CLI. If you need to use the CLI on another OS or architecture, [please reach out](https://docs.pipedream.com/support/).
Code steps use the same editor ([Monaco](https://microsoft.github.io/monaco-editor/)) used in Microsoft's [VS Code](https://code.visualstudio.com/), which supports syntax highlighting, automatic indentation, and more.
38
38
39
39
40
-
41
-
42
40
## Sharing data between steps
43
41
44
42
A Node.js step can use data from other steps using [step exports](/workflows/steps/#step-exports), it can also export data for other steps to use.
<VideoPlayersrc="https://youtu.be/9xW5UX0Zxok?t=72"title="Exporting data from a Node.js code step" />
94
+
95
95
Alternatively, use the built in `$.export` helper instead of returning data. The `$.export` creates a _named_ export with the given value.
96
96
97
97
```javascript
@@ -123,6 +123,8 @@ Regardless of using `return` or `$.export`, can only export JSON-serializable da
123
123
124
124
## Passing props to code steps
125
125
126
+
<VideoPlayersrc="https://www.youtube.com/embed/CxOdfgjThjg"title="Passing props to code steps" />
127
+
126
128
You can make code steps reusable by allowing them to accept props. Instead of hard-coding the values of variables within the code itself, you can pass them to the code step as arguments or parameters _entered in the workflow builder_.
127
129
128
130
For example, let's define a `firstName` prop. This will allow us to freely enter text from the workflow builder.
@@ -154,6 +156,8 @@ Accepting a single string is just one example, you can build a step to accept ar
154
156
155
157
## How Pipedream Node.js components work
156
158
159
+
<VideoPlayersrc="https://www.youtube.com/embed/8nnL9sIRGvk"title="Structure of a Node.js Code Step"/>
160
+
157
161
When you add a new Node.js code step or use the examples in this doc, you'll notice a common structure to the code:
158
162
159
163
```javascript
@@ -220,6 +224,8 @@ While you can save a workflow with syntax errors, it's unlikely to run correctly
220
224
221
225
## Using `npm` packages
222
226
227
+
<VideoPlayersrc="https://www.youtube.com/embed/lvTWnSAwEa8"title="Use NPM packages in code steps" />
228
+
223
229
[npm](https://www.npmjs.com/) hosts JavaScript packages: bits of code someone else has written and packaged for others to use. npm has over 400,000 packages and counting. You can use most of those on Pipedream.
<VideoPlayersrc="https://www.youtube.com/embed/6mmJyAW7kJI"title="Running asynchronous code in Node.js code steps" />
9
+
8
10
If you're not familiar with asynchronous programming concepts like [callback functions](https://developer.mozilla.org/en-US/docs/Glossary/Callback_function) or [Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises), see [this overview](https://eloquentjavascript.net/11_async.html).
<VideoPlayersrc="https://www.youtube.com/embed/rckGb8BbPuk"title="Connecting apps to Node.js Code Steps" />
9
+
8
10
When you use [prebuilt actions](/components#actions) tied to apps, you don't need to write the code to authorize API requests. Just [connect your account](/connected-accounts/#connecting-accounts) for that app and run your workflow.
9
11
10
12
But sometimes you'll need to [write your own code](/code/nodejs/). You can also connect apps to custom code steps, using the auth information to authorize requests to that app.
<VideoPlayersrc="https://www.youtube.com/embed/Fz_hjbza6Yo"title="Rerunning a Node.js code step with $.rerun"/>
79
+
78
80
Use `$.flow.rerun` when you want to run a specific step of a workflow multiple times. This is useful when you need to start a job in an external API and poll for its completion, or have the service call back to the step and let you process the HTTP request within the step.
|[New Stars](https://github.com/pipedreamhq/pipedream/blob/master/components/github/sources/new-star/new-star.js)| Github | Webhook (with extensive use of common files) |
164
+
|[New Stars](https://github.com/pipedreamhq/pipedream/blob/master/components/github/sources/new-star/new-star.js)| Github | Webhook (with extensive use of common files) |
|[Create Single Record](https://github.com/PipedreamHQ/pipedream/blob/master/components/airtable/actions/create-single-record/create-single-record.js)| Airtable |
171
171
|[Add Multiple Rows](https://github.com/PipedreamHQ/pipedream/blob/master/components/google_sheets/actions/add-multiple-rows/add-multiple-rows.mjs)| Google Sheets |
0 commit comments