# reshape-eval-code

> Evaluate all code nodes and transform to text nodes

Latest version **0.3.5** (published 2018-04-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install reshape-eval-code
pnpm add reshape-eval-code
yarn add reshape-eval-code
bun add reshape-eval-code
```

## 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.3.5 |
| Published | 2018-04-05 |
| First published | 2017-05-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 6 |
| Dependencies | 3 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Jeff Escalante |
| Maintainers | jescalan |

## Links

- npm: https://www.npmjs.com/package/reshape-eval-code
- Repository: https://github.com/reshape/eval-code
- Issues: https://github.com/reshape/eval-code/issues
- npm.io page: https://npm.io/package/reshape-eval-code

## Dependencies (3)

- [reshape-parser](https://npm.io/package/reshape-parser.md) ^0.2.1
- [reshape-code-gen](https://npm.io/package/reshape-code-gen.md) ^1.0.0
- [reshape-plugin-util](https://npm.io/package/reshape-plugin-util.md) ^0.2.1

## Recent versions

- 0.3.5 (latest) — 2018-04-05
- 0.3.4 — 2017-08-25
- 0.3.3 — 2017-07-06
- 0.3.2 — 2017-06-29
- 0.3.1 — 2017-06-29
- 0.3.0 — 2017-05-03
- 0.2.0 — 2017-05-03
- 0.1.0 — 2017-05-02

## README

# Reshape Eval Code

[![npm](https://img.shields.io/npm/v/reshape-eval-code.svg?style=flat-square)](https://npmjs.com/package/reshape-eval-code)
[![tests](https://img.shields.io/travis/reshape/eval-code.svg?style=flat-square)](https://travis-ci.org/reshape/eval-code?branch=master)
[![dependencies](https://img.shields.io/david/reshape/eval-code.svg?style=flat-square)](https://david-dm.org/reshape/eval-code)
[![coverage](https://img.shields.io/codecov/c/github/reshape/eval-code.svg?style=flat-square)](https://codecov.io/gh/reshape/eval-code)

Evaluate all code nodes and transform to text nodes

> **Note:** This project is in early development, and versioning is a little different. [Read this](http://markup.im/#q4_cRZ1Q) for more details.

### Installation

`npm install reshape-eval-code -S`

### Usage

If you have your locals and want to resolve them early so that subsequent plugins can use them directly instead of running into `code` nodes, reshape eval code is your friend. It's a very simple plugin, you just feed it your locals and it will go through all code nodes and resolve them, then run whatever they produce through a parse so that even if you produce html with your code nodes it will still come out as a full reshape AST.

```js
const reshape = require('reshape')
const expressions = require('reshape-expressions')
const evalCode = require('reshape-eval-code')

reshape({ plugins: [expressions(), evalCode({ foo: 'bar' })] })
  .process('<p>{{ foo }}</p>')
  .then((res) => {
    console.log(res.output()) // no locals required here! nice!
  })
```

### License & Contributing

- Details on the license [can be found here](LICENSE.md)
- Details on running tests and contributing [can be found here](contributing.md)

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