astro-command

0.0.7 • Public • Published

Astro Command

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

Demo

Usage

---
import { Command } from "astro-command";
---
<Command caller={import.meta.url} command="Component.py" message="from python!" />

Component.py

#!/usr/bin/env python 

import sys, json

data = json.load(sys.stdin)
print(f'<h1> Hello {data["message"]} </h1>')
  • 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

Readme

Keywords

Package Sidebar

Install

npm i astro-command

Weekly Downloads

9

Version

0.0.7

License

MIT

Unpacked Size

5.08 kB

Total Files

12

Last publish

Collaborators

  • trashhalo