# @types/babel-code-frame

> TypeScript definitions for babel-code-frame

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

## Install

```sh
npm install @types/babel-code-frame
pnpm add @types/babel-code-frame
yarn add @types/babel-code-frame
bun add @types/babel-code-frame
```

## 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.20.8 |
| Published | 2023-11-06 |
| First published | 2016-12-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51465 |
| Maintainers | types |

## Links

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

## Recent versions

- 6.20.8 (latest) — 2023-11-06
- 6.20.5 (ts3.6) — 2021-07-06
- 6.20.4 (ts3.0) — 2020-05-15
- 6.20.2 (ts2.0) — 2019-02-13
- 6.20.7 — 2023-10-17
- 6.20.6 — 2023-09-15
- 6.20.3 — 2020-05-15
- 6.20.1 — 2017-03-31
- 6.20.0 — 2016-12-11
- 6.16.0 — 2016-12-08

## README

# Installation
> `npm install --save @types/babel-code-frame`

# Summary
This package contains type definitions for babel-code-frame (https://github.com/babel/babel/tree/master/packages).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel-code-frame.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel-code-frame/index.d.ts)
````ts
interface BabelCodeFrameOptions {
    /** Syntax highlight the code as JavaScript for terminals. default: false */
    highlightCode?: boolean | undefined;
    /**  The number of lines to show above the error. default: 2 */
    linesBelow?: number | undefined;
    /**  The number of lines to show below the error. default: 3 */
    linesAbove?: number | undefined;
    /**
     * Forcibly syntax highlight the code as JavaScript (for non-terminals);
     * overrides highlightCode.
     * default: false
     */
    forceColor?: boolean | undefined;
}

/**
 * Generate errors that contain a code frame that point to source locations.
 *
 * @param rawLines Raw lines to frame
 * @param lineNumber Line number (1 indexed)
 * @param colNumber Column number
 * @param options Additional options
 *
 * @returns Framed code
 */
declare function codeFrame(
    rawLines: string,
    lineNumber: number,
    colNumber: number,
    options?: BabelCodeFrameOptions,
): string;

export = codeFrame;

````

### Additional Details
 * Last updated: Mon, 06 Nov 2023 22:41:04 GMT
 * Dependencies: none

# Credits
These definitions were written by [Mohsen Azimi](https://github.com/mohsen1).

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