Appearance
Function template
One function, or a small group of functions that always go together. Lives at docs/repos/<repo>/functions/<page-slug>.md.
Generated by npm run new:page -- <repo> function <page-slug> "<Title>".
Template
md
---
title: "{{title}}"
description: "TODO: One sentence on what this function does."
status: draft
---
# {{title}}
TODO: One-sentence summary of the function.
| Field | Value |
| --- | --- |
| Source | `TODO: path/to/file` |
| Exported from | TODO: module |
| Called by | TODO |
## Signature
```ts
// TODO: signature
function TODO(arg: TODO): TODO
```
## Purpose
TODO: What it does and why it exists.
## Inputs / Parameters
| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| TODO | TODO | TODO | TODO | TODO |
## Outputs / Return value
TODO: What it returns, including the shape of objects and what `null` or
empty results mean.
## Errors
| Condition | Behavior |
| --- | --- |
| TODO | TODO: throws / returns error value / logs |
## Usage
```js
// TODO: usage example
```
## Implementation
TODO: Add implementation details/code. Walk through the algorithm, and give
its complexity where it matters.
## Architecture
TODO: Add diagram or Mermaid diagram.
```mermaid
flowchart LR
input[/TODO: Input/] --> fn["{{title}}"]
fn --> output[/TODO: Output/]
```
## Dependencies
| Dependency | Kind | Why it's needed |
| --- | --- | --- |
| TODO | internal / external | TODO |
## Edge cases
- TODO
## Related components
- TODO: Links to related functions, modules, components or APIs.Placeholders
text
{{title}} Page title, usually the function name