sherpats reads sherpadoc (sherpa API types and functions) and writes a typescript client library
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmd/sherpats
LICENSE
Makefile
README.md
check.go
go.mod
go.sum
sherpats.go
ts.go

README.md

Sherpats

Sherpats reads the (machine-readable) documentation for a sherpa API as generated by sherpadoc, and outputs a documented typescript module with all functions and types from the sherpa documentation. Example:

sherpadoc MyAPI >myapi.json
sherpats < myapi.json > myapi.ts

Read the sherpats documentation.

Tips

At the beginning of each call of an API function, the generated typescript code reads a localStorage variable "sherpats-debug". You can use this to simulate network delay and inject failures into your calls. Example:

localStorage.setItem('sherpats-debug', JSON.stringify({waitMinMsec: 0, waitMaxMsec: 1000, failRate: 0.1}))

Info

Written by Mechiel Lukkien, mechiel@ueber.net, MIT-licensed, feedback welcome.