# acorn-node

> the acorn javascript parser, preloaded with plugins for syntax parity with recent node versions

Latest version **2.0.1** (published 2020-05-30) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install acorn-node
pnpm add acorn-node
yarn add acorn-node
bun add acorn-node
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2020-05-30 |
| First published | 2018-01-20 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 44.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Renée Kooi |
| Maintainers | ahdinosaur, anandthakker, ashaffer88, balupton, bpostlethwaite, bret, cwmma, defunctzombie, dominictarr, elnounch, emilbayes, feross, forbeslindesay, fpereira1, garann, gkatsev, goto-bus-stop, hughsk, indutny, jmm, jprichardson, jryans, leichtgewicht, lukechilds, mafintosh, mattdesl, maxogden, mellowmelon, parshap, pkrumins, sethvincent, stevemao, substack, tehshrike, terinjokes, thlorenz, ungoldman, yerkopalma, yoshuawuyts, zertosh |
| Keywords | acorn, browserify, javascript, parser |

## Links

- npm: https://www.npmjs.com/package/acorn-node
- Repository: https://github.com/browserify/acorn-node
- Issues: https://github.com/browserify/acorn-node/issues
- npm.io page: https://npm.io/package/acorn-node

## Dependencies (3)

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

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2020-05-30
- 2.0.0 — 2020-02-24
- 1.8.2 — 2019-08-13
- 1.8.1 — 2019-08-13
- 1.8.0 — 2019-08-13
- 1.7.0 — 2019-05-24
- 1.6.2 — 2018-10-25
- 1.6.1 — 2018-10-23
- 1.6.0 — 2018-09-29
- 1.5.2 — 2018-06-15
- 1.5.1 — 2018-06-15
- 1.5.0 — 2018-06-15
- 1.4.0 — 2018-06-13
- 1.3.0 — 2018-02-02
- 1.2.0 — 2018-01-26
- … 2 more at https://npm.io/package/acorn-node/versions

## README

# acorn-node

[Acorn](https://github.com/acornjs/acorn) preloaded with plugins for syntax parity with recent Node versions.

It also includes versions of the plugins compiled with [Bublé](https://github.com/rich-harris/buble), so they can be run on old Node versions (0.6 and up).

[![npm][npm-image]][npm-url]
[![travis][travis-image]][travis-url]
[![standard][standard-image]][standard-url]

[npm-image]: https://img.shields.io/npm/v/acorn-node.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/acorn-node
[travis-image]: https://img.shields.io/travis/browserify/acorn-node/master.svg?style=flat-square
[travis-url]: https://travis-ci.org/browserify/acorn-node
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[standard-url]: http://npm.im/standard

## Install

```
npm install acorn-node
```

## Usage

```js
var acorn = require('acorn-node')
```

The API is the same as [acorn](https://github.com/acornjs/acorn), but the following syntax features are enabled by default:

 - Bigint syntax `10n`
 - Numeric separators syntax `10_000`
 - Public and private class instance fields
 - Public and private class static fields
 - Dynamic `import()`
 - The `import.meta` property
 - `export * as ns from` syntax

And the following options have different defaults from acorn, to match Node modules:

 - `ecmaVersion: 2019`
 - `allowHashBang: true`
 - `allowReturnOutsideFunction: true`

```js
var walk = require('acorn-node/walk')
```

The Acorn syntax tree walker. Comes preconfigured for the syntax plugins if necessary.
See the [acorn documentation](https://github.com/acornjs/acorn#distwalkjs) for details.

## License

The files in the repo root and the ./test folder are licensed as [Apache-2.0](LICENSE.md).

The files in lib/ are generated from other packages:

- lib/bigint: [acorn-bigint](https://github.com/acornjs/acorn-bigint]), MIT
- lib/class-private-elements: [acorn-class-private-elements](https://github.com/acornjs/acorn-class-private-elements), MIT
- lib/export-ns-from: [acorn-export-ns-from](https://github.com/acornjs/acorn-export-ns-from), MIT
- lib/import-meta: [acorn-import-meta](https://github.com/acornjs/acorn-import-meta), MIT
- lib/numeric-separator: [acorn-numeric-separator](https://github.com/acornjs/acorn-numeric-separator]), MIT
- lib/static-class-features: [acorn-static-class-features](https://github.com/acornjs/acorn-static-class-features), MIT

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