diff options
| author | Philipp Tanlak <philipp.tanlak@gmail.com> | 2023-12-04 18:30:19 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-04 18:30:19 +0100 |
| commit | 0f9e334a19e7224ee08b611107029b4cd86c0267 (patch) | |
| tree | 9740c7edc47f8e81d6a1352c94160d584bfb9f26 /examples/urls_from_file.js | |
| parent | 8c68e0ed414bfb323d6e94db55c95db13797ef8e (diff) | |
Support file imports for .txt and .json (#25)v0.6.0
Diffstat (limited to 'examples/urls_from_file.js')
| -rw-r--r-- | examples/urls_from_file.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/examples/urls_from_file.js b/examples/urls_from_file.js new file mode 100644 index 0000000..0231032 --- /dev/null +++ b/examples/urls_from_file.js @@ -0,0 +1,11 @@ +import urls from "./urls.txt" + +export const config = { + urls: urls.split("\n").filter(Boolean) +}; + +export default function({ doc }) { + return { + title: doc.find("title").text().trim(), + }; +} |