> For the complete documentation index, see [llms.txt](https://docs.zongsoft.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zongsoft.com/documentation/en/framework/externals/projects/lua.md).

# Lua (lua)

The Lua project's capability scope, deployment products, integration entry points, and usage boundaries.

Provides Lua expression evaluation through NLua and KeraLua. The business chooses Lua through the common evaluator contract, and script syntax and return values are still determined by Lua.

| Item                  | value                                                                         |
| --------------------- | ----------------------------------------------------------------------------- |
| source code directory | `externals/lua`                                                               |
| main bag              | `Zongsoft.Externals.Lua`                                                      |
| Companion theme       | [Scripts and Expressions](/documentation/en/framework/externals/scripting.md) |

## Deployment and Usage Portal

Append the main package to the existing host's [Deployment checklist](/documentation/en/references/deploy-files.md), and retain the plugin list, assembly and ancillary running resources in the package:

{% code title="Application.deploy (append fragment)" %}

```ini
[plugins zongsoft externals lua]
nuget:Zongsoft.Externals.Lua
```

{% endcode %}

Match expression evaluator by name `Lua` after application initialization. An example calculation would use `return x + y`, with the variable passed in its own dictionary for each call.

## Integration Steps

1. Deploy native runtime libraries that match the operating system and architecture.
2. Use the Lua name and syntax according to the public calling method of the script topic, and verify the input and return value types.
3. Cover multiple return values, null values, syntax errors, and consecutive calls before integrating business rules.

For specific configuration, calling examples and related basic concepts, see [Scripts and Expressions](/documentation/en/framework/externals/scripting.md).

## Project Boundaries

{% hint style="info" %}
💡 Each Evaluate creates and releases Lua state; do not assume that any script has time limits or security isolation based on this. Sharing Global is only suitable for configuring stable content during the startup phase.
{% endhint %}

## Further Reading

[Browse extensions by project](/documentation/en/framework/externals/projects.md) · [Scripts and Expressions](/documentation/en/framework/externals/scripting.md) · [source code and project description](https://github.com/Zongsoft/framework/tree/main/externals/lua)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.zongsoft.com/documentation/en/framework/externals/projects/lua.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
