juana-dev

0.0.7 • Public • Published

Juana

JSON-RPC description language.

Installation

npm i juana

Usage

From source:

import juana from 'juana';

const juanaDocument = juana`
name = "Math API";
version = "1.0.0";

@over http "https://math.juana.dev/v1/call";

add(a: float, b: float): float;
sub(a: float, b: float): float;
mul(a: float, b: float): float;
div(a: float, b: float): float;
`;

console.log(juanaDocument);

By url:

import juana from 'juana';

const juanaDocument = await juana.byUrl('https://math.juana.dev/v1');

console.log(juanaDocument);

API

jd.variables // list of top level variables (name, version etc.)
jd.types // list of types
jd.methods // list of methods
jd.directives // list of directives

jd.find(name) // find method or type by name
jd.findType(name) // find type by name
jd.findMethod(name) // find method by name
jd.findDirective(name) // find directives by name

jd.addType(type) // add type to context
jd.addMethod(method) // add method to context
jd.addDirective(directive) // add directive to context

Readme

Keywords

none

Package Sidebar

Install

npm i juana-dev

Weekly Downloads

0

Version

0.0.7

License

MIT

Unpacked Size

3.63 MB

Total Files

29

Last publish

Collaborators

  • kohutd