@textsurf/kink
v0.1.1
Published
<br/> <br/> <br/> <br/> <br/> <br/> <br/>
Downloads
1
Readme
Installation
pnpm add @textsurf/kink
yarn add @textsurf/kink
npm i @textsurf/kink
Example
import Kink from '@textsurf/kink'
const host = '@textsurf/kink'
type Base = {
syntax_error: {}
}
type Name = keyof Base
Kink.base(host, 'syntax_error', () => ({
code: 1,
note: 'Syntax error',
}))
Kink.code(host, (code: number) => code.toString(16).padStart(4, '0'))
export default function kink<N extends Name>(form: N, link?: Base[N]) {
return new Kink(Kink.makeBase(host, form, link))
}
import kink from './example.js'
try {
throw kink('syntax_error')
} catch (e) {
console.log(e)
}
License
MIT
TextSurf
This is being developed by the folks at TextSurf, a California-based project for helping humanity master information and computation. Find us on Twitter, LinkedIn, and Facebook. Check out our other GitHub projects as well!