synapse

JavaScript Elevated

Synapse is a TypeScript toolchain for developing modern software. Simplify development, automate deployment, optimize performance.

macOS/Linux
Windows
curl -fsSL https://synap.sh/install | bash

Infrastructure from Code

Write cloud-agnostic code that seamlessly integrates with top cloud providers. Iterate quickly with local deployments. Synapse ensures your application uses cloud resources securely and efficiently.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { Bucket } from 'synapse:srl/storage'
import { Function } from 'synapse:srl/compute'

const bucket = new Bucket()

const fn = new Function(async () => {
await bucket.put('hello.txt', 'hello, world!')
})

export async function main() {
await fn()
const data = await bucket.get('hello.txt', 'utf-8')
console.log(data)
}

Full-stack Development

Build powerful frontend applications alongside infrastructure. Control where functions are executed with hooks like useServer.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { Suspense } from 'react'
import { Counter } from 'synapse:srl/storage'
import { useServer } from '@cohesible/synapse-websites'

const viewCounter = new Counter()
const inc = () => viewCounter.inc()

function Views() {
const views = useServer(inc)

return <p>{Intl.NumberFormat('en-us').format(views)} views</p>
}

export default function ViewCounter() {
return (
<Suspense fallback={<p>Loading...</p>}>
<Views />
</Suspense>
)
}