Noze.io is an attempt to carry over the Node.js ideas into pure Swift. It uses libdispatch for event-driven, non-blocking I/O. Noze.io is built around type-safe back-pressure aware pull-streams (using Swift generics) operating on batches of items. Instead of working with just bytes, deal with batches of Unicode lines or database records or HTML responses or - you get the idea. Be efficient: Stream everything and ßatch.

Note: Consider this deprecated. Noze.io works on top of GCD and is overall really inefficient and slow for various reasons. Macro.swift is an effort the eventually rewrite it on top of SwiftNIO.

A focus is to keep the API similar to Node. Not always possible - Swift is not JavaScript - but pretty close. It comes with rechargeables included, Noze.io is self-contained and doesn’t require any extra dependencies. No extra C modules, pure Swift.
Haz awezome modules such as: cows, leftpad, express, and redis.

Noze.io works in Cocoa environments as well as on Linux. It uses Swift 3 or 4 on macOS or tuxOS. Head over to our Start page for install instructions.

Is it a good idea? You tell us. Not sure, but we think it might be, because: a) While Swift looks like JavaScript, it is actually a very high performance, statically typed and AOT-compiled language, b) Code often looks better in Swift, mostly due to the trailing-closure syntax, c) No monkey patching while still providing extensions. There are cons too.

Shows us some code!

There is a reasonably large collection of simple, focused: Noze.io examples. But here you go, the “standard” Node example, a HelloWorld httpd:

import http

http.createServer { req, res in 
  res.writeHead(200, [ "Content-Type": "text/html" ])
  res.end("<h1>Hello World</h1>")
}
.listen(1337)

An echo daemon, just piping the in-end of a socket into its own out-end:

import net

net.createServer { sock in
  sock.write("Welcome to Noze.io!\r\n")
  sock | sock
}
.listen(1337)

More complex stuff including a Todo-MVC backend can be found in the Noze.io examples. Like what you see? Head over to our Start page to get started.


Combine

At WWDC 2019, alongside SwiftUI, Apple released a new framework called Combine. While the API is completely different, it seems conceptually quite close to what the core of Noze.io provides: streams of events, with backpressure support and transformations.

August 9, 2019 Read More

𝓶Express

Looks like more and more people are looking into µExpress in search for a small, approachable and Express like, SwiftNIO API. Yet µExpress was “just” intended as a tutorial on how to create a tiny web framework on top of NIO, not as a standalone library. Should we do 𝓶Express?

January 10, 2019 Read More

Noze.io in 2018

Just a small update on the state of Noze.io in 2018. What we might be able to do. Or not. And other things of interest.

February 1, 2018 Read More

Noze 0.5.0 - Swift 3 only

Good news everyone! We can finally make a release which leaves Swift 2 behind and works with a Swift 3 on both, macOS and tuxOS. We call that release: 0.5.0.

October 11, 2016 Read More

Cows. Lots of cows!

I’m proud to announce the most amazing and magical release yet: Noze.io 0.2.10 Cows. With a lot of hard work (and a sweating Swift3 compiler) we managed to include over 400 very nice cows into the Noze.io framework.

June 27, 2016 Read More

Noze.io 0.2.5

Last week we announced our first public Noze.io v0.2.x branch, codename “Less than Prefect”, accompanied by the 0.2.3 release. This week we pushed a 0.2.5 release.

June 11, 2016 Read More