# esanimate

> Helpers for converting back and forth between esprima/SpiderMonkey ASTs and JavaScript objects.

Latest version **2.0.0** (published 2020-11-22) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install esanimate
pnpm add esanimate
yarn add esanimate
bun add esanimate
```

## 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.0 |
| Published | 2020-11-22 |
| First published | 2015-10-07 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 13.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Andreas Lind |
| Maintainers | papandreou |

## Links

- npm: https://www.npmjs.com/package/esanimate
- Repository: https://github.com/papandreou/esanimate
- Homepage: https://github.com/papandreou/esanimate#readme
- Issues: https://github.com/papandreou/esanimate/issues
- npm.io page: https://npm.io/package/esanimate

## Dependencies (2)

- [esprima](https://npm.io/package/esprima.md) ^4.0.1
- [escodegen](https://npm.io/package/escodegen.md) ^2.0.0

## Recent versions

- 2.0.0 (latest) — 2020-11-22
- 1.1.1 — 2019-09-01
- 1.1.0 — 2016-06-15
- 1.0.3 — 2015-10-11
- 1.0.2 — 2015-10-09
- 1.0.1 — 2015-10-08
- 1.0.0 — 2015-10-07

## README

# esanimate

[![NPM version](https://badge.fury.io/js/esanimate.svg)](http://badge.fury.io/js/esanimate)
[![Build Status](https://travis-ci.org/papandreou/esanimate.svg?branch=master)](https://travis-ci.org/papandreou/esanimate)
[![Coverage Status](https://img.shields.io/coveralls/papandreou/esanimate.svg)](https://coveralls.io/r/papandreou/esanimate?branch=master)
[![Dependency Status](https://david-dm.org/papandreou/esanimate.svg)](https://david-dm.org/papandreou/esanimate)

Convert back and forth between esprima/SpiderMonkey ASTs and JavaScript objects.

Example:

```js
require('esanimate').astify({ foo: 'bar', quux: 123 });
```

Returns:

```javascript
{ type: 'ObjectExpression',
  properties:
   [ { kind: 'init',
       key: { type: 'Identifier', name: 'foo' },
       value: { type: 'Literal', value: 'bar' } },
     { kind: 'init',
       key: { type: 'Identifier', name: 'quux' },
       value: { type: 'Literal', value: 123 } } ] }
```

And the other way around:

```javascript
esanimate.objectify({
  type: 'ObjectExpression',
  properties: [
    {
      kind: 'init',
      key: { type: 'Identifier', name: 'foo' },
      value: { type: 'Literal', value: 'bar' },
    },
  ],
});
```

Output:

```
{ foo: 'bar' }
```

## License

3-clause BSD license -- see the `LICENSE` file for details.

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