# check-syntax

> Checks the syntax of an entry point and it's (application-level) dependencies as per the currently installed Node version.

Latest version **0.2.0** (published 2017-09-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install check-syntax
pnpm add check-syntax
yarn add check-syntax
bun add check-syntax
```

Provides the command `check-syntax`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2017-09-18 |
| First published | 2017-09-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | David Mark Clements |
| Maintainers | davidmarkclements |

## Links

- npm: https://www.npmjs.com/package/check-syntax
- Repository: https://github.com/davidmarkclements/check-syntax
- Homepage: https://github.com/davidmarkclements/check-syntax#readme
- Issues: https://github.com/davidmarkclements/check-syntax/issues
- npm.io page: https://npm.io/package/check-syntax

## Dependencies (1)

- [dependency-tree](https://npm.io/package/dependency-tree.md) ^5.11.0

## Recent versions

- 0.2.0 (latest) — 2017-09-18
- 0.1.0 — 2017-09-18
- 0.0.1 — 2017-09-18
- 0.0.0 — 2017-09-18

## README

# check-syntax

Checks the syntax of an entry point and it's (application-level) dependencies 
as per the currently installed Node version.

## About

The `node -c` command allows us to check the syntax of a single file.

The `check-syntax` module allows us to check the syntax of all the files
in a dependency tree (excluding any dependencies in the `node_modules` folder).

## CLI

### Install 

```sh
npm install -g check-syntax
```

### Use

```sh
check-syntax <entry-point>
```

## API

### Install

```sh
npm install check-syntax
```

### Use

```js
var checkSyntax = require('check-syntax')
var someEntryPoint = 'my/js/file.js'
console.log(checkSyntax(someEntryPoint)) // outputs an array of objects, {loc, code, msg}
```

#### Reporter 

To use the CLI reporter programatically:

```js
var report = require('check-syntax/report')
var someEntryPoint = 'my/js/file.js'
report(someEntryPoint) // same as output as check-syntax command, will exit immediately 
```

If a `pass` callback is supplied, the process won't exit but 
instead will call the callback with the first arg set to either `true` 
or `false` based on whether the syntax check was successful.

```js
report(someEntryPoint, (pass) => {
  if (pass) console.log('hooray')
  else console.log('boo')
})
```


### License

MIT

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