# scripts/

This guide was generated by `xuda-cli`.

You can remove all generated folder guides later with:

~~~bash
npm run clean:readmes
~~~

Use this folder for Xuda `javascript` units.

## What belongs here

- reusable custom JavaScript logic
- formatting helpers
- pure computation or transformation utilities
- code that should stay visible and named instead of buried in component workflows

## Recommended blocks

- `<meta lang="json5">`
- optional `<params lang="json5">`
- `<code>`

## Important rules

- keep the unit focused on one job
- use params for input and output contracts
- prefer this folder for reusable JS instead of copying inline expressions everywhere

## Example

~~~xml
<meta lang="json5">
{
  id: "normalize_student_name",
  menuTitle: "Normalize Student Name"
}
</meta>

<params lang="json5">
{
  in: {
    raw_name_in: "string"
  },
  out: {
    normalized_name_out: "string"
  }
}
</params>

<code>
return (@raw_name_in || "")
  .trim()
  .toLowerCase()
  .replace(/\b\w/g, (letter) => letter.toUpperCase());
</code>
~~~
