Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/trashhalo/astro-command

run commands as astro components
https://github.com/trashhalo/astro-command

astro pin

Last synced: 3 months ago
JSON representation

run commands as astro components

Awesome Lists containing this project

README

        

# Astro Command

Astro component for static rendering of commands. This allows you build components in any language.

[Demo](https://github.com/trashhalo/astro-command/blob/main/src/components/Demo.astro)

## Usage

```astro
---
import { Command } from "astro-command";
---

```
Component.py
```python
#!/usr/bin/env python

import sys, json

data = json.load(sys.stdin)
print(f'

Hello {data["message"]}

')
```

* caller: url of the caller so we can use it to look up relative paths
* command: name of the command to execute. relative path from the caller
* props: all props are passed to command as json via stdin
* html: generated html sent out via stdout embedded