$ npm install hyperschema-swiftSwift code generation for Hyperschema. Transforms schema definitions into Swift structs with binary codec conformance using https://github.com/holepunchto/compact-encoding-swift.
npm i hyperschema-swift
const SwiftHyperschema = require('hyperschema-swift')
const schema = SwiftHyperschema.from('./spec')
// Get generated Swift source as a string
const code = schema.toCode()
// Or write a complete Swift package to disk
SwiftHyperschema.toDisk(schema, './output')
toDisk writes a ready-to-build Swift package:
output/
Package.swift
Sources/Schema.swift
schema.json
Apache-2.0