Swift Package Index


Run Foundation Process asynchronously and perform easy reads and writes in closures.


  • The latest stable release is 1.0.11. Released 2 years ago.
  • The last commit to master was 2 years ago.

Swift Version Compatibility

  • 1.0.11 and master
    5.3
    5.2
    5.1
    5.0
    4.2
Full build results

Platform Compatibility

  • 1.0.11 and master
    iOS
    macOS(Intel)
    macOS(ARM)
    Linux
    tvOS
    watchOS
Full build results

ProcessRunner

Build Status Swift Version

Run Foundation Process asynchronously and perform easy reads and writes in closures.

var didWrite = false
var result = ""
let process = try? ProcessRunner(launchPath: "/usr/bin/openssl")
process!.stdOut { (handle: FileHandle) in
    let str = String.init(data: handle.availableData as Data, encoding: .utf8)!
    print("stdOut: \(str)")
    if str == "OpenSSL> " && !didWrite {
        didWrite = true
        process?.write("foobar\n".data(using: .utf8)!)
    }
}
process!.stdErr { (handle: FileHandle) in
    let str = String.init(data: handle.availableData as Data, encoding: .utf8)!
    print("stdErr: \(str)")
}
process!.launch()