# @types/syntax-error

> TypeScript definitions for syntax-error

Latest version **1.4.5** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/syntax-error
pnpm add @types/syntax-error
yarn add @types/syntax-error
bun add @types/syntax-error
```

## 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 | 1.4.5 |
| Published | 2023-11-07 |
| First published | 2018-12-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51446 |
| Maintainers | types |

## Links

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

## Dependencies (1)

- [acorn](https://npm.io/package/acorn.md) ^7.0.0

## Recent versions

- 1.4.5 (latest) — 2023-11-07
- 1.4.2 (ts4.0) — 2022-07-20
- 1.4.1 (ts2.0) — 2019-02-14
- 1.4.4 — 2023-10-18
- 1.4.3 — 2023-09-25
- 1.4.0 — 2018-12-18

## README

# Installation
> `npm install --save @types/syntax-error`

# Summary
This package contains type definitions for syntax-error (https://github.com/browserify/syntax-error).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/syntax-error.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/syntax-error/index.d.ts)
````ts
import * as acorn from "acorn";

/**
 * Check the source code string 'src' for syntax errors. Optionally you can specify a filename
 * file that will show up in the output.
 * If 'src' has a syntax error, return an error object err that can be printed or stringified.
 * If there are no syntax errors in 'src', return undefined.
 * Options will be passed through to acorn-node. acorn-node defaults to options
 * that match the most recent Node versions.
 */
declare function syntaxError(
    src: any,
    file?: string,
    opts?: acorn.Options,
): (SyntaxError & { line: number; column: number; annotated: string; inspect(): string }) | undefined;

export = syntaxError;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
 * Dependencies: [acorn](https://npmjs.com/package/acorn)

# Credits
These definitions were written by [TeamworkGuy2](https://github.com/TeamworkGuy2).

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