# esprima-to-value

> convert an ast(object) to its object for Esprima

Latest version **1.0.5** (published 2015-09-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install esprima-to-value
pnpm add esprima-to-value
yarn add esprima-to-value
bun add esprima-to-value
```

## 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 | 1.0.5 |
| Published | 2015-09-25 |
| First published | 2015-09-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Yorkie Liu |
| Maintainers | yorkie |
| Keywords | esprima |

## Links

- npm: https://www.npmjs.com/package/esprima-to-value
- Repository: https://github.com/yorkie/esprima-to-value
- Homepage: https://github.com/yorkie/esprima-to-value#readme
- Issues: https://github.com/yorkie/esprima-to-value/issues
- npm.io page: https://npm.io/package/esprima-to-value

## Dependencies (1)

- [esprima-get-object](https://npm.io/package/esprima-get-object.md) ^1.0.1

## Recent versions

- 1.0.5 (latest) — 2015-09-25
- 1.0.4 — 2015-09-25
- 1.0.3 — 2015-09-23
- 1.0.2 — 2015-09-23
- 1.0.1 — 2015-09-23

## README

# esprima-to-value

convert an esprima ast object/literal to an real object

### Install

```sh
$ npm install esprima-to-value --save
```

### Usage

```js
const esprima = require('esprima');
const toValue = require('esprima-to-value');

const ast = esprima.parse(code);
console.log(ast.body);
/**
 * [
 *   { type: 'Literal', value: 10 },
 *   { type: 'ObjectExpression', properties: ... },
 *   { type: 'ArrayExpression', elements: ... },
 *   { type: 'FunctionExpression', body: { type: 'ReturnStatement', ... } },
 *  ]
 */
console.log(toValue(ast.body));
/**
 * will output:
 * [ 10, { ... }, [ ... ], 'res.body' ]
 */
```

### Author

- [Yorkie Lui](https://github.com/yorkie)

### License

MIT

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