Generate an AST from a string template (quasiquote implementation). Current stable version is 6.26.0 (legacy Babel 6). Release cadence: infrequent; part of Babel monorepo, which has moved on to v7/v8. Key differentiator: allows building AST nodes using template syntax instead of manual node construction, but only works with Babel 6 AST types. For Babel 7+, use @babel/template instead.
npm install babel-templateVerified import paths — ran on the pinned version, not inferred.
Shows how to create a template function using babel-template and invoke it with AST node replacements.
Migrate to @babel/template: npm install @babel/template --save-dev and update imports to import template from '@babel/template'.
Ensure placeholders are all uppercase or follow identifier rules; avoid using keywords.
Use @babel/template with @babel/parser for modern syntax support.
Run 'npm install --save-dev babel-template' for Babel 6, or use '@babel/template' for Babel 7+.
Use default import: import template from 'babel-template'.