{"id":13622122,"url":"https://github.com/yamlscript/yamlscript","last_synced_at":"2025-04-19T09:53:47.472Z","repository":{"id":47791667,"uuid":"516298848","full_name":"yamlscript/yamlscript","owner":"yamlscript","description":"Use YAML syntax to define a set of tasks declaratively, YAMLScript will compile it into Javascript code that runs on Deno. Think about Lisp, but in YAML","archived":false,"fork":false,"pushed_at":"2022-09-27T01:37:53.000Z","size":361,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T07:05:15.703Z","etag":null,"topics":["ansible","deno","dotfiles","dotfiles-manager","workflow-automation","yaml-configuration"],"latest_commit_sha":null,"homepage":"https://yamlscript.deno.dev/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yamlscript.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-21T09:04:03.000Z","updated_at":"2024-10-29T11:12:27.000Z","dependencies_parsed_at":"2022-08-12T13:50:38.076Z","dependency_job_id":null,"html_url":"https://github.com/yamlscript/yamlscript","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamlscript%2Fyamlscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamlscript%2Fyamlscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamlscript%2Fyamlscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamlscript%2Fyamlscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yamlscript","download_url":"https://codeload.github.com/yamlscript/yamlscript/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249015965,"owners_count":21198824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","deno","dotfiles","dotfiles-manager","workflow-automation","yaml-configuration"],"created_at":"2024-08-01T21:01:14.451Z","updated_at":"2025-04-15T05:33:41.315Z","avatar_url":"https://github.com/yamlscript.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003c!-- deno-fmt-ignore-file --\u003e\n# YAMLScript\n\nWe use [YAML syntax](https://yaml.org/) to define a set of tasks declaratively,\nYAMLScript will help you compile it into Javascript code that runs on Deno.\nThink about [Lisp](https://en.wikipedia.org/wiki/Lisp_(programming_language)),\nbut in YAML.\n\n\u003e **Note** You need to know the basic syntax of YAML, javascript, and maybe a\n\u003e little [Deno](https://deno.land/manual), if you havn't, check\n\u003e out[Learn YAML in Y minutes](https://learnxinyminutes.com/docs/yaml/) and\n\u003e [Learn Javascript in Y minutes](https://learnxinyminutes.com/docs/javascript/),\n\u003e it's not hard!\n\n\u003e **Warning** This project is still in a very early stage, the api may consider\n\u003e changes.\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Installation](#installation)\n- [Simple Usage](#simple-usage)\n- [Advanced Usage](#advanced-usage)\n- [CLI](#cli)\n- [Links](#links)\n\n## Introduction\n\nYAMLScript is designed to solve the most common problems with minimal knowledge.\nIt can be considered as an alternative for\n[dotfiles utilities](https://dotfiles.github.io/utilities/) such as\n[chezmoi](https://www.chezmoi.io/), or an alternative to automated workflows\nsuch as [Ansible](https://www.ansible.com/), it can also be a low-code\nalternative to [IFTTT](https://ifttt.com/), [Zapier](https://zapier.com/),\n[Pipedream](https://pipedream.com/), etc.\n\n## Installation\n\n1. Yamlscript depends on Deno, so you should install\n   [Deno](https://deno.land/#installation) first.\n2. Install YAMLScript by running\n\n```bash\ndeno install -A https://deno.land/x/yamlscript/ys.ts\n```\n\nrun task files:\n\n```bash\n# run some files\nys run a.ys.yml\nys run **/*.yml\nys run a.ys.yml b.ys.yml\n# run all .ys.yml files\nys run -A\n# run some directories\nys run -d a/b/c\n\n# build is same as run\nys build a.ys.yml\n```\n\nBuild task file and deploy the compiled code to serverless services such as\n[Deno Deploy](https://deno.com/deploy):\n\n```bash\nys build task.ys.yml \u0026\u0026 deployctl deploy --project=helloworld ./dist/task.js\n```\n\n\n## Task Config\n\nIn YAMLScript, The following interface is the only property we need to\nunderstand, they are all optional.\n\n```typescript\ninterface Task {\n  id?: string;\n  name?: string;\n  from?: string;\n  use?: string;\n  args?: unknown | unknown[];\n  loop?: string | number | unknown[];\n  if?: boolean | string;\n  throw?: boolean;\n}\n```\n\nAnd the compiled Javascript code is human readable, so if anything goes wrong,\nwe can easily locate and fix it. If you run into problems, go to the compiled\nJavascript code, which is located in the `dist` directory by default.\n\n## Simple Usage\n\n\n### Basic\n\n```yaml\n# We use `def` to define a new variable\n# `id` will be the variable name, `args` will be the value\n- use: def\n  id: obj\n  args:\n    list:\n      - Hello\n      - true\n    foo:\n      cat: 10\n\n# We use javascript template string ${expression} for string interpolation\n# You can use any valid js template expression here, even function.\n# ${} can be escaped as \\${} if needed\n- use: console.log\n  args:\n    - ${obj.list[0]} World\n    - ${obj.foo.cat}\n    - ${JSON.stringify(obj.foo)}\n\n```\n\nThis will be compiled to:\n\n```javascript\n\n// Task #0: obj\nlet obj = {\n  \"list\": [\n    `Hello`,\n    true\n  ],\n  \"foo\": {\n    \"cat\" : 10\n  }\n};\n\n// Task #1\nresult = console.log(`${obj.list[0]} World`,`${obj.foo.cat}`,`${JSON.stringify(obj.foo)}`);\n\n```\n\n\n### Use\n\n```yaml\n# `use` is the operator name of the a task.\n# We can use any Deno runtime function here\n- id: response\n  use: fetch\n  args: https://actionsflow.github.io/test-page/reddit-sample.json\n- id: json\n  use: response.json\n- use: console.log\n  args: $json\n# We also have some built-in functions, e.g., fetch rss feed entries\n\n- use: rss.entries\n  args: https://actionsflow.github.io/test-page/hn-rss.xml\n\n# We also have a built-in lodash\n# All built-in functions can be found here:\n# https://github.com/yamlscript/yamlscript/blob/main/globals/mod.ts\n\n# this will print: [2, 1]\n- use: _.uniq\n  args:\n    - [2, 1, 2]\n\n# use alias?\n\n- from: https://deno.land/std@0.149.0/path/mod.ts\n  use: extname as getExt\n  args: test.js\n- use: assertEquals\n  args:\n    - .js\n    - $result\n\n# use instance?\n\n- use: new URL\n  args: http://www.example.com/dogs\n- use: assertEquals\n  args:\n    - www.example.com\n    - $result.hostname\n\n```\n\nThis will be compiled to:\n\n```javascript\nimport { extname as getExt } from \"https://deno.land/std@0.149.0/path/mod.ts\";\n\n// Task #0: response\nresult = await fetch(`https://actionsflow.github.io/test-page/reddit-sample.json`);\nconst response = result;\n\n// Task #1: json\nresult = await response.json();\nconst json = result;\n\n// Task #2\nresult = console.log(json);\n\n// Task #3\nresult = await rss.entries(`https://actionsflow.github.io/test-page/hn-rss.xml`);\n\n// Task #4\nresult = _.uniq([\n  2,\n  1,\n  2\n]);\n\n// Task #5\nresult = await getExt(`test.js`);\n\n// Task #6\nresult = assertEquals(`.js`,result);\n\n// Task #7\nresult = new URL(`http://www.example.com/dogs`);\n\n// Task #8\nresult = assertEquals(`www.example.com`,result.hostname);\n\n```\n\n\n### Args\n\n```yaml\n# `args` can be array or other type\n# if it's not an array, will be the first argument for the task\n- use: rss.entries\n  args: https://actionsflow.github.io/test-page/hn-rss.xml\n\n# You can visit https://requestbin.com/r/enyvb91j5zjv9/23eNPamD4DK4YK1rfEB1FAQOKIj\n# to check the http request.\n- use: fetch\n  args:\n    - https://enyvb91j5zjv9.x.pipedream.net/\n    - method: POST\n      headers:\n        Content-Type: application/json\n      body: |\n        {\n          \"title\": \"Hello world\"\n        }\n\n```\n\nThis will be compiled to:\n\n```javascript\n\n// Task #0\nresult = await rss.entries(`https://actionsflow.github.io/test-page/hn-rss.xml`);\n\n// Task #1\nresult = await fetch(`https://enyvb91j5zjv9.x.pipedream.net/`,{\n  \"method\" : `POST`,\n  \"headers\": {\n    \"Content-Type\" : `application/json`\n  },\n  \"body\" : `{\n  \"title\": \"Hello world\"\n}\n`\n});\n\n```\n\n\n### Result\n\n```yaml\n- use: Math.max\n  args: [1, 9, 5]\n\n# We use `result` to indicate the return result of the previous task\n# This will print \"9\"\n- use: console.log\n  args: ${result}\n\n# How to print number 9?\n# use `$expression`\n# $expression can be escaped as \\$expression if needed\n- use: console.log\n  args: $result\n\n# We can also use `id` to define a identifier of the task\n- id: max\n  use: Math.max\n  args: [1, 9, 5]\n\n# then we can use the $id to represent the task result.\n- use: console.log\n  args:\n    - $max\n\n```\n\nThis will be compiled to:\n\n```javascript\n\n// Task #0\nresult = Math.max(1,9,5);\n\n// Task #1\nresult = console.log(`${result}`);\n\n// Task #2\nresult = console.log(result);\n\n// Task #3: max\nresult = Math.max(1,9,5);\nconst max = result;\n\n// Task #4\nresult = console.log(max);\n\n```\n\n\n### If\n\n```yaml\n# We can use `if` to control structures\n# args is an built-in function, return the args\n- use: def\n  id: num\n  args: 5\n\n# You can use any js expression here, you may omit the expression syntax `$`\n# Cause we evaluates the if conditional as an expression.\n# this will print: yes, the args is greater than 4\n- if: num \u003e 4\n  use: console.log\n  args: yes, the args is greater than 4\n\n- if: true\n  use: console.log\n  args: yes, it's true\n\n```\n\nThis will be compiled to:\n\n```javascript\n\n// Task #0: num\nlet num = 5;\n\n// Task #1\nif (num \u003e 4) {\n  result = console.log(`yes, the args is greater than 4`);\n}\n\n// Task #2\nresult = console.log(`yes, it's true`);\n\n```\n\n\n### Loop\n\n```yaml\n# We use `loop` to define a loop, it can be an literal array\n# You can access the item by using `item`\n# the index by using `index`\n\n# This will print \"1. foo\\n2. bar\"\n- loop:\n    - foo\n    - bar\n  use: console.log\n  args: ${index}. ${item}\n\n- id: sources\n  use: def\n  args:\n    - - 1\n      - 2\n# use $sources to get literals result\n\n- id: loopResults\n  loop: $sources\n  use: _.multiply\n  args:\n    - $item\n    - 2\n# loopResults will be an array, every result of the loop will be pushed.\n\n```\n\nThis will be compiled to:\n\n```javascript\n\n// Task #0\n{\n  const item = `foo`;\n  index = 0;\n  result = console.log(`${index}. ${item}`);\n}\n{\n  const item = `bar`;\n  index = 1;\n  result = console.log(`${index}. ${item}`);\n}\nindex = 0;\n\n// Task #1: sources\nlet sources = [\n  1,\n  2\n];\n\n// Task #2: loopResults\nlet loopResults = [];\nfor await (const item of await sources){\n  result = _.multiply(item,2);\n  loopResults.push(result);\n  index++;\n}\nindex=0;\n\n```\n\n\n### Function\n\n```yaml\n# We also support define a function by using `defn`\n# args[0] is the first argument, args[1] is the second argument.\n- use: defn\n  id: myFunction\n  args:\n    - use: _.upperCase\n      args: $args[0]\n\n# Then we can use this function\n- use: myFunction\n  args: abc\n\n# assertEquals is a built-in function to do some tests\n# which is from Deno std\n# https://deno.land/std@0.149.0/testing#usage\n- use: assertEquals\n  args:\n    - $result\n    - ABC\n\n```\n\nThis will be compiled to:\n\n```javascript\n\n// Task #0: myFunction\nasync function myFunction(...args){\n\n  // Task #0_0\n  result = _.upperCase(args[0]);\n\n  return result;\n}\n\n// Task #1\nresult = await myFunction(`abc`);\n\n// Task #2\nresult = assertEquals(result,`ABC`);\n\n```\n\n\n### Shell\n\n```yaml\n# We use colon plus cmd to run a command\n- id: echo\n  use: :echo Hello World\n\n# Result will be:\n# {\n#   stdout: \"Hello World\\n\",\n#   stderr: \"\",\n#   combined: \"Hello World\\n\",\n#   status: { success: true, code: 0 },\n#   retries: 0\n# }\n\n- use: assertEquals\n  args:\n    - $echo.stdout\n    - \"Hello World\\n\"\n\n```\n\nThis will be compiled to:\n\n```javascript\nimport { __yamlscript_create_process } from \"https://deno.land/x/yamlscript@0.0.9/globals/cmd/mod.ts\";\n\n// Task #0: echo\nconst __yamlscript_default_use_0 =  __yamlscript_create_process();\nresult = await __yamlscript_default_use_0`echo Hello World`;\nconst echo = result;\n\n// Task #1\nresult = assertEquals(echo.stdout,`Hello World\n`);\n\n```\n\n\n## Advanced Usage\n\n\n### 1 Prevent Throw Error\n\n```yaml\n# Sometimes we want to ignore error, and let the tasks continue on error\n# we use throw: false to prevent YAMLScript throw an error.\n# when using throw: false, the result will be an object\n# {\n#  value: unknown\n#  done: boolean\n# }\n# when task is failed, the value will be the error\n# when task is success, the value will be the function result.\n- use: JSON.parse\n  args: \"foo?bar\"\n  throw: false\n  id: errorExample\n- use: assertEquals\n  args:\n    - $errorExample.done\n    - false\n- use: assertEquals\n  args:\n    - $errorExample.value.message\n    - Unexpected token 'o', \"foo?bar\" is not valid JSON\n\n```\n\nThis will be compiled to:\n\n```javascript\n\n// Task #0: errorExample\nlet errorExample;\ntry {\n  result = await JSON.parse(`foo?bar`);\n  errorExample = result;\n  result = {\n    value: result,\n    done: true\n  };\n  errorExample = result;\n} catch (error) {\n  result = {\n    value: error,\n    done: false\n  };\n  errorExample = result;\n}\n\n// Task #1\nresult = assertEquals(errorExample.done,false);\n\n// Task #2\nresult = assertEquals(errorExample.value.message,`Unexpected token 'o', \"foo?bar\" is not valid JSON`);\n\n```\n\n\n### 2 New Instance\n\n```yaml\n# How to create class instance?\n# just use new functioname\n- use: new Date\n  args: 2022-07-25\n- use: assertEquals\n  args:\n    - \"1658707200000\"\n    - ${result.getTime()}\n\n```\n\nThis will be compiled to:\n\n```javascript\n\n// Task #0\nresult = new Date(`2022-07-25T00:00:00.000Z`\n);\n\n// Task #1\nresult = assertEquals(`1658707200000`,`${result.getTime()}`);\n\n```\n\n\n### Return\n\n```yaml\n# Use `return` to end the function\n- use: defn\n  id: myFunction\n  args:\n    - use: console.log\n      args: foo\n    - use: return\n      if: true\n    - use: console.log\n      args: this will not be printed\n- use: myFunction\n\n```\n\nThis will be compiled to:\n\n```javascript\n\n// Task #0: myFunction\nasync function myFunction(...args){\n\n  // Task #0_0\n  result = console.log(`foo`);\n\n  // Task #0_1\n  return;\n\n  // Task #0_2\n  result = console.log(`this will not be printed`);\n\n  return result;\n}\n\n// Task #1\nresult = await myFunction();\n\n```\n\n\n### Rss\n\n```yaml\n# fetch rss entries and notify some webhook\n- id: entries\n  use: rss.entries\n  args: https://actionsflow.github.io/test-page/hn-rss.xml\n\n# You can visit https://requestbin.com/r/enyvb91j5zjv9/23eNPamD4DK4YK1rfEB1FAQOKIj\n# to check the http request.\n- loop: $entries\n  use: fetch\n  args:\n    - https://enyvb91j5zjv9.x.pipedream.net/\n    - method: POST\n      headers:\n        Content-Type: application/json\n      body: |\n        {\n          \"title\": \"${item.title.value}\",\n          \"link\":  \"${item.links[0].href}\"\n        }\n\n```\n\nThis will be compiled to:\n\n```javascript\n\n// Task #0: entries\nresult = await rss.entries(`https://actionsflow.github.io/test-page/hn-rss.xml`);\nconst entries = result;\n\n// Task #1\nfor await (const item of await entries){\n  result = await fetch(`https://enyvb91j5zjv9.x.pipedream.net/`,{\n    \"method\" : `POST`,\n    \"headers\": {\n      \"Content-Type\" : `application/json`\n    },\n    \"body\" : `{\n  \"title\": \"${item.title.value}\",\n  \"link\":  \"${item.links[0].href}\"\n}\n`\n  });\n  index++;\n}\nindex=0;\n\n```\n\n\n### Cache\n\n```yaml\n# what if we want to deduplicate the rss items?\n- id: entries\n  use: rss.entries\n  args: https://actionsflow.github.io/test-page/hn-rss.xml\n\n- name: get cache\n  id: kv\n  use: fs.readJSONFileWithDefaultValue\n  args:\n    - ./.yamlscript/cache/kv.json\n    - ${}\n- use: defn\n  id: handleRssEntry\n  args:\n    - use: return\n      if: kv[args[0].links[0].href]\n    - name: notify\n      use: fetch\n      args:\n        - https://enyvb91j5zjv9.x.pipedream.net/\n        - method: POST\n          headers:\n            Content-Type: application/json\n          body: |\n            {\n              \"title\": \"${args[0].title.value}\",\n              \"link\":  \"${args[0].links[0].href}\"\n            }\n    - use: _.assign\n      args:\n        - $kv\n        - $[args[0].links[0].href]: true\n\n# You can visit https://requestbin.com/r/enyvb91j5zjv9/23eNPamD4DK4YK1rfEB1FAQOKIj\n# to check the http request.\n- loop: $entries\n  use: handleRssEntry\n  args: $item\n\n- name: set to cache\n  use: fs.writeJSONFile\n  args:\n    - ./.yamlscript/cache/kv.json\n    - $kv\n\n```\n\nThis will be compiled to:\n\n```javascript\n\n// Task #0: entries\nresult = await rss.entries(`https://actionsflow.github.io/test-page/hn-rss.xml`);\nconst entries = result;\n\n// Task #1: get cache\nresult = await fs.readJSONFileWithDefaultValue(`./.yamlscript/cache/kv.json`,{});\nconst kv = result;\n\n// Task #2: handleRssEntry\nasync function handleRssEntry(...args){\n\n  // Task #2_0\n  if (kv[args[0].links[0].href]) {\n    return;\n  }\n\n  // Task #2_1  : notify\n  result = await fetch(`https://enyvb91j5zjv9.x.pipedream.net/`,{\n    \"method\" : `POST`,\n    \"headers\": {\n      \"Content-Type\" : `application/json`\n    },\n    \"body\" : `{\n  \"title\": \"${args[0].title.value}\",\n  \"link\":  \"${args[0].links[0].href}\"\n}\n`\n  });\n\n  // Task #2_2\n  result = _.assign(kv,{\n    [args[0].links[0].href] : true\n  });\n\n  return result;\n}\n\n// Task #3\nfor await (const item of await entries){\n  result = await handleRssEntry(item);\n  index++;\n}\nindex=0;\n\n// Task #4: set to cache\nresult = await fs.writeJSONFile(`./.yamlscript/cache/kv.json`,kv);\n\n```\n\n\n### Define Global Variables\n\n```yaml\n# Sometimes we need to define a global var in child block\n# We can use `defg` to define a global variable.\n- use: Math.max\n  args:\n    - 1\n    - 9\n\n- if: result===9\n  use: defg\n  id: foo\n  args: bar\n\n- use: assertEquals\n  args:\n    - $foo\n    - bar\n\n```\n\nThis will be compiled to:\n\n```javascript\n\n// Task #0\nresult = Math.max(1,9);\n\n// Task #1: foo\nif (result===9) {\n  foo = `bar`;\n}\n\n// Task #2\nresult = assertEquals(foo,`bar`);\n\n```\n\n\n### Deno Deploy\n\n```yaml\n- from: https://deno.land/std@0.149.0/http/server.ts\n  use: serve\n  args: $handler\n  if: build.env.YS_NO_SERVE !== \"1\"\n\n- use: defn\n  id: handler\n  args:\n    - use: new Response\n      args: Hello World\n\n```\n\nThis will be compiled to:\n\n```javascript\nimport { serve } from \"https://deno.land/std@0.149.0/http/server.ts\";\n\n// Task #0\nresult = await serve(handler);\n\n// Task #1: handler\nasync function handler(...args){\n\n  // Task #1_0\n  result = await new Response(`Hello World`);\n\n  return result;\n}\n\n```\n\n\n## CLI\n\n```bash\n  Usage:   ys\n  Version: 0.0.1\n\n  Description:\n\n    yamlscript is written in yaml format and can be compiled into javscript that runs in deno.\n\n  Options:\n\n    -h, --help     - Show this help.\n    -V, --version  - Show the version number for this program.\n    -v, --verbose  - Enable verbose output.\n\n  Commands:\n\n    run    [file...]  - run files\n    build  [file...]  - build yaml file to js file\n```\n\n\n## Notes\n\nThis README.md file is generated by the following YAMLScript.\n\n```yaml\n# get readme.template.md content\n- id: readmeTemplate\n  use: Deno.readTextFile\n  args: ./docs/README.tmpl.md\n\n# get yaml content\n- id: yamlMakeReadmeScript\n  use: Deno.readTextFile\n  args: ./docs/make_readme.ys.yml\n\n# get source content and target\n- use: defn\n  id: mapFiles\n  args:\n    - id: sourceContent\n      use: Deno.readTextFile\n      args: ${args[0]}\n    - id: sourceTasks\n      use: fs.readYAMLFile\n      args: ${args[0]}\n    - id: targetCode\n      use: YAMLScript.getCompiledCode\n      args:\n        - $sourceTasks\n    - id: title\n      from: https://deno.land/x/case@2.1.1/mod.ts\n      use: titleCase\n      args: ${args[2].slice(3,-7)}\n    - use: return\n      args:\n        title: $title\n        source: $sourceContent\n        target: ${targetCode.topLevelCode}${targetCode.mainFunctionBodyCode}\n\n# get simple usage sources and targets\n- id: simpleUsageFiles\n  use: Deno.readDirSync\n  args: ./docs/simple-usage\n\n- loop: $simpleUsageFiles\n  id: simpleUsageFileNames\n  use: _.get\n  args:\n    - $item\n    - name\n# sort\n- id: sortedSimpleUsageFiles\n  use: _.sortBy\n  args:\n    - $simpleUsageFileNames\n\n- id: simpleUsageSources\n  loop: $sortedSimpleUsageFiles\n  use: mapFiles\n  args:\n    - ./docs/simple-usage/${item}\n    - $index\n    - $item\n# get advanced usage sources and targets\n- id: advancedFiles\n  use: Deno.readDir\n  args: ./docs/advanced\n\n- loop: $advancedFiles\n  id: advancedFileNames\n  use: _.get\n  args:\n    - $item\n    - name\n# sort\n- id: sortedAdvancedFiles\n  use: _.sortBy\n  args:\n    - $advancedFileNames\n\n- id: advancedSources\n  loop: $sortedAdvancedFiles\n  use: mapFiles\n  args:\n    - ./docs/advanced/${item}\n    - $index\n    - $item\n# use mustache to render readme.template.md\n- id: readmeContent\n  from: https://jspm.dev/mustache@4.2.0\n  use: default.render\n  args:\n    - $readmeTemplate\n    - simpleUsageSources: $simpleUsageSources\n      advancedSources: $advancedSources\n      yamlMakeReadmeScript: $yamlMakeReadmeScript\n\n# readme content to generate toc\n\n# write to readme.md\n- use: Deno.writeTextFile\n  args:\n    - README.md\n    - $readmeContent\n\n```\n\nSee all [built-in functions](/globals/mod.ts)\n\nInspired by [Common Lisp](https://common-lisp.net/),\n[Clojure](https://clojure.org/),\n[Denoflow](https://github.com/denoflow/denoflow),\n[Rash](https://github.com/rash-sh/rash),\n[Comtrya](https://github.com/comtrya/comtrya)\n\n## Links\n\n- [Github Repo](https://github.com/yamlscript/yamlscript)\n- [Deno land Module](deno.land/x/yamlscript)\n- [Official Site](https://yamlscript.deno.dev)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyamlscript%2Fyamlscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyamlscript%2Fyamlscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyamlscript%2Fyamlscript/lists"}