Functions for reporting on imported packages in a unified-latex
Abstract Syntax Tree (AST).
If you are building a linter or some other system that needs to know which packages have been included
via \usepackage{...}
or \RequirePackage{...}
.
npm install @unified-latex/unified-latex-util-packages
This package contains both esm and commonjs exports. To explicitly access the esm export,
import the .js
file. To explicitly access the commonjs export, import the .cjs
file.
List all packages referenced via \includepackage{...}
or \RequirePackage{...}
function listPackages(tree: Ast.Ast): Ast.String[];
Parameters
Param | Type |
---|---|
tree | Ast.Ast |