{"id":29410559,"url":"https://github.com/yaml/yamlscript-lua","last_synced_at":"2026-05-16T08:43:03.176Z","repository":{"id":304081206,"uuid":"1017668815","full_name":"yaml/yamlscript-lua","owner":"yaml","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-11T14:36:04.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-18T06:51:15.218Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","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/yaml.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-10T22:59:32.000Z","updated_at":"2025-07-11T14:36:06.000Z","dependencies_parsed_at":"2025-07-11T06:31:26.121Z","dependency_job_id":"9a287e2d-8bfb-4dc5-a0f2-90e0ea837ad0","html_url":"https://github.com/yaml/yamlscript-lua","commit_stats":null,"previous_names":["yaml/yamlscript-lua"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/yaml/yamlscript-lua","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaml%2Fyamlscript-lua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaml%2Fyamlscript-lua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaml%2Fyamlscript-lua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaml%2Fyamlscript-lua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yaml","download_url":"https://codeload.github.com/yaml/yamlscript-lua/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaml%2Fyamlscript-lua/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266334729,"owners_count":23913033,"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","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-07-11T07:00:52.500Z","updated_at":"2026-05-16T08:43:03.170Z","avatar_url":"https://github.com/yaml.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- DO NOT EDIT — THIS FILE WAS GENERATED --\u003e\n\nYAMLScript\n==========\n\nAdd Logic to Your YAML Files\n\n\n## Quick Start\n\nThis library lets you load YAML files that may or may not contain\n[YAMLScript](https://yamlscript.org) functional programming logic.\nYou can use it as a drop-in replacement for your current YAML loader.\n\nHere's an example `config.yaml` that makes use of YAMLScript functions.\n\n```yaml\n# config.yaml with YAMLScript:\n!ys-0:\n\n# Define variables\ndb-host =: ENV.DB_HOST || 'localhost'\ndb-port =: ENV.DB_PORT || 5432\ndeploy =: ENV.DEPLOYMENT || 'dev'\n:when deploy !~ /^(dev|stage|prod)/:\n  die: |\n    Invalid deployment value '$deploy'.\n    Must be one of: dev | stage | prod\n\n# Normal YAML data\ndescription: Dynamic application configuration\n\n# Dynamic data values\ndatabase:\n  host:: db-host\n  port:: db-port:num\n  name:: \"app_$deploy\"\n\n# Import external data\nfeatures:: load('common.yaml').features\n\n# Use logic and conditions\ncache:\n  # Variable scoped to this mapping\n  enabled =: deploy == 'production'\n\n  directory: .cache\n  enabled:: enabled\n  limit: 100\n  # Conditional key/value pairs\n  :when enabled::\n    limit:: 1000\n    ttl:: 60 * 60  # 3600\n```\n\n\n## What is YAMLScript?\n\nYAMLScript is a functional programming language that can be embedded in YAML.\nIts syntax is 100% YAML so files that embed it are still valid YAML files.\n\nThe YAMLScript project provides YAML loader libraries for many programming\nlanguages.\nThey can be used to load any YAML config files properly, whether or not they\ncontain functional programming logic.\n\nIt's perfect for:\n\n* **Configuration files** that need logic, variables, and dynamic values\n* **Data transformation** with built-in functions for JSON, YAML, and text\n  processing\n* **Templating** with powerful string interpolation and data manipulation\n* **Scripting** as a complete functional programming language\n\n\n## Key Features\n\n* **Drop-in YAML replacement** – Works with your existing YAML files\n* **Variables \u0026 functions** – Define and reuse values throughout your files\n* **External data loading** – Import JSON, YAML, or data from URLs\n* **Conditional logic** – Use if/then/else and pattern matching\n* **Data transformation** – Built-ins for transforming \u0026 manipulating data\n* **String interpolation** – Embed expressions/variables directly in strings\n* **No JVM required** – Runs as a native library despite compiling to Clojure\n\n\n## How It Works\n\nYAMLScript extends YAML with a simple, elegant syntax:\n\n```yaml\n# file.yaml\n!ys-0:               # Enable YAMLScript\n\nname =: 'World'       # Variable assignment\nnums =:: [1, 2, 3]    # Any YAML value\n\n# Literal YAML with ':'\na key: a value\n\n# Evaluated expressions with '::'\nmessage:: \"Hello, $name!\"\nsum:: nums.reduce(+)\ntimestamp:: now():str\n```\n\nYou can load this file from a program as described below, or you can use the\n`ys` YAMLScript binary to load the file from the command line:\n\n```bash\n$ ys -Y file.yaml\na key: a value\nmessage: Hello, World!\nsum: 6\ntimestamp: '2025-09-14T22:35:42.832470203Z'\n```\n\nUnder the hood, YAMLScript compiles YAML to Clojure and evaluates it, giving\nyou access to a rich functional programming environment.\n\n## Lua Usage\n\nUse `yamlscript` as a drop-in replacement for your current YAML loader:\n\n```lua\n-- program.lua\nlocal yamlscript = require(\"yamlscript\")\n\nlocal ys = yamlscript.new()\n\n-- Load from file\nlocal file = io.open(\"config.yaml\", \"r\")\nlocal input = file:read(\"*a\")\nfile:close()\n\nlocal config = ys:load(input)\nprint(config)\n```\n\n\n## Installation\n\nInstall YAMLScript for Lua and the `libys.so` shared library:\n\n```bash\n# Install dependencies\nluarocks install cffi-lua\nluarocks install lua-cjson\n\n# Install shared library\ncurl -sSL https://yamlscript.org/install | bash\n\n# Add to LUA_PATH\nexport LUA_PATH=\"$(pwd)/lib/?.lua;;\"\n```\n\nSee \u003chttps://yamlscript.org/doc/install/\u003e for more info.\n\n\n### Requirements\n\n* Lua 5.1 or higher\n* cffi-lua library\n* lua-cjson library\n\n## See Also\n\n* [YAMLScript Web Site](https://yamlscript.org)\n* [Learn YAMLScript](https://exercism.org/tracks/yamlscript)\n* [YAMLScript Blog](https://yamlscript.org/blog)\n* [YAMLScript Source Code](https://github.com/yaml/yamlscript)\n* [YAMLScript Programs](https://rosettacode.org/wiki/Category:YAMLScript)\n* [YAML](https://yaml.org)\n* [Clojure](https://clojure.org)\n\n\n## Authors\n\n## Authors\n\n* Ingy döt Net \u003cingy@ingy.net\u003e\n\n## License \u0026 Copyright\n\nCopyright 2022-2025 Ingy döt Net \u003cingy@ingy.net\u003e\n\nThis project is licensed under the terms of the `MIT` license.\nSee [LICENSE](https://github.com/yaml/yamlscript/blob/main/License) for more\ndetails.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaml%2Fyamlscript-lua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyaml%2Fyamlscript-lua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaml%2Fyamlscript-lua/lists"}