avdl2json

raw JSON →
2.2.5 verified Fri May 01 auth: no javascript maintenance

A Node.js compiler that converts AVDL (Avro IDL) files to JSON schema. Version 2.2.5 is the latest stable release. This package is specifically designed for Keybase's AVDL format and is unlikely to receive further updates. It has no notable alternative packages for this specific conversion, making it unique for Keybase-related projects.

error SyntaxError: Cannot use import statement outside a module
cause Package uses ESM imports but project is not configured as module.
fix
Add "type": "module" to package.json or use .mjs extension.
error Error: Cannot find module 'avdl2json'
cause Package not installed correctly or path issue.
fix
Run 'npm install avdl2json' and ensure node_modules is in scope.
npm install avdl2json
yarn add avdl2json
pnpm add avdl2json

Converts an AVDL file to JSON schema using the compileFile function.

import { compileFile } from 'avdl2json';

async function convert() {
  const jsonSchema = await compileFile('path/to/example.avdl');
  console.log(JSON.stringify(jsonSchema, null, 2));
}

convert().catch(console.error);