# @types/babylon

> TypeScript definitions for babylon

Latest version **6.16.9** (published 2023-11-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/babylon
pnpm add @types/babylon
yarn add @types/babylon
bun add @types/babylon
```

## Health

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

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 6.16.9 |
| Published | 2023-11-06 |
| First published | 2016-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51441 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/babylon
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babylon
- npm.io page: https://npm.io/package/@types/babylon

## Dependencies (1)

- [@types/babel-types](https://npm.io/package/@types/babel-types.md) *

## Recent versions

- 6.16.9 (latest) — 2023-11-06
- 6.16.6 (ts3.6) — 2021-07-06
- 6.16.5 (ts2.8) — 2019-02-13
- 6.16.2 (ts2.3) — 2017-07-20
- 6.16.1 (ts2.0) — 2017-05-04
- 6.16.8 — 2023-10-17
- 6.16.7 — 2023-09-15
- 6.16.4 — 2018-11-05
- 6.16.3 — 2018-06-12
- 6.16.0 — 2017-03-09
- 6.7.15 — 2016-11-29
- 6.7.14 — 2016-09-19
- 6.7.13 — 2016-07-14
- 6.7.12-alpha — 2016-07-08
- 6.7.11-alpha — 2016-07-03
- … 6 more at https://npm.io/package/@types/babylon/versions

## README

# Installation
> `npm install --save @types/babylon`

# Summary
This package contains type definitions for babylon (https://github.com/babel/babylon).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babylon.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babylon/index.d.ts)
````ts
import { Expression, File } from "babel-types";

export function parse(code: string, opts?: BabylonOptions): File;

export function parseExpression(input: string, options?: BabylonOptions): Expression;

export interface BabylonOptions {
    /**
     * By default, import and export declarations can only appear at a program's top level.
     * Setting this option to true allows them anywhere where a statement is allowed.
     */
    allowImportExportEverywhere?: boolean | undefined;

    /**
     * By default, a return statement at the top level raises an error. Set this to true to accept such code.
     */
    allowReturnOutsideFunction?: boolean | undefined;

    allowSuperOutsideMethod?: boolean | undefined;

    /**
     * Indicate the mode the code should be parsed in. Can be either "script" or "module".
     */
    sourceType?: "script" | "module" | undefined;

    /**
     * Correlate output AST nodes with their source filename. Useful when
     * generating code and source maps from the ASTs of multiple input files.
     */
    sourceFilename?: string | undefined;

    /**
     * Array containing the plugins that you want to enable.
     */
    plugins?: PluginName[] | undefined;
}

export type PluginName =
    | "estree"
    | "jsx"
    | "flow"
    | "typescript"
    | "classConstructorCall"
    | "doExpressions"
    | "objectRestSpread"
    | "decorators"
    | "classProperties"
    | "exportExtensions"
    | "asyncGenerators"
    | "functionBind"
    | "functionSent"
    | "dynamicImport";

````

### Additional Details
 * Last updated: Mon, 06 Nov 2023 22:41:04 GMT
 * Dependencies: [@types/babel-types](https://npmjs.com/package/@types/babel-types)

# Credits
These definitions were written by [Troy Gerwien](https://github.com/yortus), and [Marvin Hagemeister](https://github.com/marvinhagemeister).

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