A web runtime for JavaScript and TypeScript.
No build. No framework.
No bull.
Write server code inside your HTML, save the file, and refresh. Routing, forms, sessions, and a database come built in.
Free-range and open source · Still growing
One file. Front to back.
The form and the code that answers it, together.
<?js
import { field } from 'cow:web'
let name = 'friend'
if (req.method() === 'POST') {
const form = await req.formData()
const value = field(form, 'name')
name = value.trim().slice(0, 60) || 'friend'
}
?>
<h2>Hello, <?= h(name) ?>!</h2>
<form method="post">
<label>Your name
<input name="name" maxlength="60"
placeholder="Clover">
</label>
<button>Say hello</button>
</form><?ts
import { field } from 'cow:web'
let name: string = 'friend'
if (req.method() === 'POST') {
const form = await req.formData()
const value = field(form, 'name')
name = value.trim().slice(0, 60) || 'friend'
}
?>
<h2>Hello, <?= h(name) ?>!</h2>
<form method="post">
<label>Your name
<input name="name" maxlength="60"
placeholder="Clover">
</label>
<button>Say hello</button>
</form>Hello, friend!
Give Cow a name to say hello to.
The code runs on the server. The HTML goes to the browser.
See how pages are writtenYour files
know the way.
Pages get their URLs from your files and folders. Add a Cow file to your site and it’s ready to visit. No router to set up.
How pages workindex.cow/about.cow/aboutblog/index.cow/blog/cow site<?js
export function greet(name) {
return `Hello, ${name}!`
}<?js
import { greet } from './_greetings.cow'
?>
<h1><?= h(greet('Clover')) ?></h1>Start small.
Room to graze.
One file is a fine place to start. As your app grows, share code with modules and reuse HTML with includes.
How modules and includes workComing from PHP? You’ll feel at home.
Speak your language.
JavaScript or TypeScript, in pages and modules.
Cow runs either without a separate build step.
Bring the herd.
Keep using familiar npm packages.
Install them, then import them in your Cow code.
Pick your pasture.
Run Cow with the JavaScript runtime you prefer.
cow site --runtime nodeFresh from
the field.
Take a look around a working Cow app.
See how the pieces fit together.
Got an idea?
Let it loose.
Make your first page. See where it takes you.
Free, open source, and still growing.