
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
pug-linker
Advanced tools
The pug-linker npm package is a part of the Pug templating engine ecosystem. It is used internally by Pug to link together the abstract syntax tree (AST) nodes generated by the Pug parser. This linking process is essential for transforming the parsed Pug code into a format that can be compiled into HTML.
Linking AST Nodes
This feature allows you to link the AST nodes generated by the Pug parser. The `pugLinker` function takes an AST as input and returns a linked AST, which is ready for further compilation into HTML.
const pugLinker = require('pug-linker');
const ast = /* some AST generated by pug-parser */;
const linkedAst = pugLinker(ast);
The pug-parser package is responsible for parsing Pug templates into an abstract syntax tree (AST). While pug-linker focuses on linking these AST nodes, pug-parser is the initial step in the process, converting raw Pug code into a structured format.
The pug-lexer package is used to tokenize Pug templates, breaking them down into a series of tokens that can be parsed into an AST. It works in conjunction with pug-parser and pug-linker to transform Pug code into HTML.
The pug-code-gen package takes a linked AST and generates JavaScript code that can render HTML. It is the final step in the Pug compilation process, following the linking of AST nodes by pug-linker.
Link multiple pug ASTs together using include/extends
npm install pug-linker
var link = require('pug-linker');
link(ast)
Flatten the Pug AST of inclusion and inheritance.
This function merely links the AST together; it doesn't read the file system to resolve and parse included and extended files. Thus, the main AST must already have the ASTs of the included and extended files embedded in the FileReference
nodes. pug-load
is designed to do that.
MIT
FAQs
Link multiple pug ASTs together using include/extends
The npm package pug-linker receives a total of 989,825 weekly downloads. As such, pug-linker popularity was classified as popular.
We found that pug-linker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.