To get started with we recommend

Download is hosted on GitHub, you can download the thing from the project site, quicklinks: Clone to a local directory (recommended) via …

git clone

… or download as zip.

To build in Xcode, just open the contained and select the desired scheme.

To build in a Unix shell, just type make. If you are using a Swift 3 drop, you can also call swift build.


There is a reasonably large collection of simple and focused examples over here: examples. Three of them which may provide a good starting point:

  • express-simple is a more complex example using Mustache templates, middleware, forms, routes and JSON.
  • connect-git is a demo for typed streaming. git is invoked as a subprocess, its streamed byte output is converted into streams of Unicode lines which are parsed into streams of log-structs, which are emitted into an HTML stream.
  • echod is the simplest echo daemon possible.

How to build the examples? In Xcode, choose the desired samples-xyz scheme (e.g. samples-express-simple) and build&run. On the shell, just type make or make samples in the root folder.


There isn’t much specific documentation yet. Help is very much appreciated :-)

If you know Node.js

If you don’t know Swift yet, checkout the Swift Tour by Apple. Then come back. Welcome back, you now know basic Swift, congratulations. is pretty similar to Node.js. Import fs, http, net, etc and most functions are named the same like in Node.js. There is concat, nextTick and console.log.

It is, however, not exactly the same. Differences are being collected in for Node people.

Node original:

fs.readFile('example_log.txt', function (err, logData) {
  if (err) { console.error("failed:", err); return; }
  console.log("got data:", logData);

The same in

fs.readFile("example_log.txt") { err, logData in
  if err != nil { console.error("failed:", err); return }
  console.log("got data:", logData)

If you don’t know Node.js

If you don’t know Node.js yet, having a look at some Node.js or Express.js tutorials/documentation isn’t the worst idea. Two nice ones: Stream Handbook and Express Hello World.

In short: is built around asynchronous streams which emit events when data is available or when a stream is ready to write data. Those streams can be piped into each other, just like streams on the Unix shell (think ls|sort|uniq).

An example from connect-git:

let s = spawn("git", "log", "-100", "--pretty=format:%H|%an|<%ae>|%ad")
  | readlines
  | through2(linesToRecords)
  | through2(recordsToHTML)
  | response

You get the point. All this is running asynchronously and with back-pressure control (that is, if an output stream is busy and can’t take more input, the input stream will pause).

More information can be found in for Non-Node people.