npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

hyperschema-swift

0.3.0

@GitHub Actions

npmHomeRepoSnykSocket
Downloads:6422
$ npm install hyperschema-swift
DailyWeeklyMonthlyYearly

hyperschema-swift

Swift 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

Usage

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

License

Apache-2.0