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.
Common errors
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.
Install
npm install avdl2json yarn add avdl2json pnpm add avdl2json Imports
- avdl2json wrong
const avdl2json = require('avdl2json')correctimport { compile } from 'avdl2json' - compile wrong
const { compile } = require('avdl2json')correctimport { compile } from 'avdl2json' - compileFile wrong
import compileFile from 'avdl2json'correctimport { compileFile } from 'avdl2json'
Quickstart
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);