@tookey-io/candid-parser
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @tookey-io/candid-parser

Weekly Downloads

0

Version

0.0.6

License

MIT

Unpacked Size

51.9 kB

Total Files

17

Last publish

Collaborators

  • tookey