Swiftpack.co -  Macro-swift/Macro as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
Macro-swift/Macro
An unopinionated SwiftNIO based asynchronous I/O framework, Node.js like.
.package(url: "https://github.com/Macro-swift/Macro.git", from: "0.8.10")

Macro

A small, unopinionated "don't get into my way" / "I don't wanna wait" asynchronous web framework for Swift. With a strong focus on replicating the Node APIs in Swift. But in a typesafe, and fast way.

Macro is a more capable variant of µExpress. The goal is still to keep a small core, but add some Noze.io modules and concepts.

Eventually it might evolve into Noze.io v2 (once backpressure enabled streams are fully working).

The companion MacroExpress package adds Express.js-like middleware processing and functions, as well as templates. MacroLambda has the bits to directly deploy Macro applications on AWS Lambda.

Streams

Checkout Noze.io for people who don't know Node, most things apply to Macro as well.

What does it look like?

The Macro Examples package contains a few examples which all can run straight from the source as swift-sh scripts.

The most basic HTTP server:

#!/usr/bin/swift sh
import Macro // @Macro-swift ~> 0.8.0

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

Macro also provides additional Node-like modules, such as:

  • fs
  • path
  • jsonfile
  • JSON
  • basicAuth
  • querystring

Environment Variables

  • macro.core.numthreads
  • macro.core.iothreads
  • macro.core.retain.debug
  • macro.concat.maxsize
  • macro.streams.debug.rc

Links

Who

Macro is brought to you by the Always Right Institute and ZeeZide. We like feedback, GitHub stars, cool contract work, presumably any form of praise you can think of.

There is a #microexpress channel on the Noze.io Slack. Feel free to join!

GitHub

link
Stars: 18
Last commit: 5 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Release Notes

Zero-Eight-Zero
28 weeks ago

Things are getting more stable.

  • more description's
  • more READMEs
  • more comments
  • fix some bugs

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API