Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 689 Bytes

README.md

File metadata and controls

38 lines (28 loc) · 689 Bytes

Candid to JSON parser

This library parses Internet Computed IDL (candid) to JSON format.

Usage

Install library from npmjs:

npm install @tookey-io/candid-parser
# or 
pnpm install @tookey-io/candid-parser
# or 
yarn add @tookey-io/candid-parser
# or 

Load and use:

import {parseIdlPretty, parseIdl } "@tookey-io/candid-parser";

const did = `
service : {
  foo: () -> (nat) query;
  bar: () -> (text) query;
}
`

const jsonPretty = parseIdlPretty(did)
const jsonMinimized = parseIdl(did) 

Examples

ICPC-1 Huge JSON Simple Canister JSON Hello example JSON