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
A collection of postprocessing examples for [flat](https://github.com/githubocto/flat). You can import and use them directly, or treat them as a starting point for writing your own postprocessing scripts.
3
+
A collection of postprocessing [helper functions](https://deno.land/x/flat/mod.ts) and examples for [Flat Data](https://github.com/githubocto/flat).
4
+
5
+
These examples and functions are written in [Deno](https://deno.land/), a new language created by the same founders of Node.js and meant to improve on many aspects of Node.
4
6
5
7
## Usage
6
8
7
-
Your postprocessing scripts must read from the path passed as the first invocation argument, and print out the path to the processed data.
9
+
When writing a [Flat Data]() Action, you can specify a path to a postprocessing Deno script that can manipulate the data downloaded by Flat even further.
10
+
11
+
```yaml
12
+
- name: Fetch data
13
+
uses: githubocto/flat@v2
14
+
with:
15
+
http_url: http://api.coindesk.com/v2/bpi/currentprice.json # The endpoint to fetch
16
+
downloaded_filename: btc-price.json # The http_url gets saved and renamed in our repository as btc-price.json
17
+
postprocess: postprocess.ts # A postprocessing javascript or typescript file written in Deno
18
+
```
8
19
9
-
The functions exported here are helpers to cut down on boilerplate.
20
+
This is an example of a postprocessing script. Notice the use of `Deno.args[0]` to pass in the path of the `downloaded_filename`.
0 commit comments