# acorn-private-methods

> Support for private methods in acorn

Latest version **1.0.0** (published 2021-02-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install acorn-private-methods
pnpm add acorn-private-methods
yarn add acorn-private-methods
bun add acorn-private-methods
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-02-08 |
| First published | 2018-01-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=4.8.2 |
| Dependencies | 1 |
| Unpacked size | 29.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Maintainers | marijn, adrianheine, rreverser |

## Links

- npm: https://www.npmjs.com/package/acorn-private-methods
- Repository: https://github.com/acornjs/acorn-private-methods
- npm.io page: https://npm.io/package/acorn-private-methods

## Dependencies (1)

- [acorn-private-class-elements](https://npm.io/package/acorn-private-class-elements.md) ^1.0.0

## Recent versions

- 1.0.0 (latest) — 2021-02-08
- 0.3.3 — 2020-08-13
- 0.3.2 — 2020-06-11
- 0.3.1 — 2020-04-22
- 0.3.0 — 2019-02-09
- 0.2.3 — 2019-02-09
- 0.2.2 — 2019-01-30
- 0.2.1 — 2018-11-06
- 0.2.0 — 2018-09-14
- 0.1.1 — 2018-02-09
- 0.1.0 — 2018-01-13

## README

# Private methods and getter/setters support for Acorn

[![NPM version](https://img.shields.io/npm/v/acorn-private-methods.svg)](https://www.npmjs.org/package/acorn-private-methods)

This is a plugin for [Acorn](http://marijnhaverbeke.nl/acorn/) - a tiny, fast JavaScript parser, written completely in JavaScript.

It implements support for private methods, getters and setters as defined in the stage 3 proposal [Private methods and getter/setters for JavaScript classes](https://github.com/tc39/proposal-private-methods). The emitted AST follows the [ESTree experimental Class Features design](https://github.com/estree/estree/blob/master/experimental/class-features.md).

## Usage

This module provides a plugin that can be used to extend the Acorn `Parser` class:

```javascript
const {Parser} = require('acorn');
const privateMethods = require('acorn-private-methods');
Parser.extend(privateMethods).parse('class X { #a() {} }');
```

or as an ECMAScript Module:

```javascript
import {Parser} from 'acorn';
import privateMethods from 'acorn-private-methods';
Parser.extend(privateMethods).parse('class X { #a() {} }');
```

## License

This plugin is released under an [MIT License](./LICENSE).

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