# @jamestalmage/babel-template

> Generate an AST from a string template.

Latest version **6.3.13** (published 2016-01-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jamestalmage/babel-template
pnpm add @jamestalmage/babel-template
yarn add @jamestalmage/babel-template
bun add @jamestalmage/babel-template
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: no vulnerabilities; high maintenance score; popular repo.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 6.3.13 |
| Published | 2016-01-28 |
| First published | 2016-01-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+7 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 43972 |
| Author | Sebastian McKenzie |
| Maintainers | jamestalmage |

## Links

- npm: https://www.npmjs.com/package/@jamestalmage/babel-template
- Repository: https://github.com/babel/babel/tree/master/packages/babel-template
- Homepage: https://babeljs.io/
- npm.io page: https://npm.io/package/@jamestalmage/babel-template

## Dependencies (5)

- [lodash](https://npm.io/package/lodash.md) ^3.10.1
- [babylon](https://npm.io/package/babylon.md) ^6.3.13
- [babel-types](https://npm.io/package/babel-types.md) ^6.3.13
- [babel-runtime](https://npm.io/package/babel-runtime.md) ^5.0.0
- [babel-traverse](https://npm.io/package/babel-traverse.md) ^6.3.13

## Recent versions

- 6.3.13 (latest) — 2016-01-28

## README

# babel-template

> Generate an AST from a string template.

## Install

```sh
$ npm install babel-template
```

## Usage

```js
import template from 'babel-template';
import generate from 'babel-generator';
import * as t from 'babel-types';

const buildRequire = template(`
  var IMPORT_NAME = require(SOURCE);
`);

const ast = buildRequire({
  IMPORT_NAME: t.identifier('myModule'),
  SOURCE: t.stringLiteral('my-module')
});

console.log(generate(ast).code);
```

```js
var myModule = require('my-module');
```

---
_Source: https://npm.io/package/@jamestalmage/babel-template · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
