Introduction

Parse AdonisJS Lucid models from their AST: parseModel returns each @column and @computed key with its declared type plus nullable, optional and array flags

Lucid Parser is a tool to retrieve Lucid models properties information by parsing the AST Tree.

This become usefull when types information provided by Typescript metadatas are not sufficient as Lucid Parser is able to retrieve type information for nullable, optional and array properties.

Installation

npm install @foadonis/lucid-parser

Usage

import { parseModel } from '@foadonis/lucid-parser'

const { columns, computed } = parseModel(import.meta.resolve('#models/user'))

On this page