yihui/knitr — pull request #823 by jlburkhead (2014-07-30 05:28:28+00:00)
Title: Add node engine

Added node to the engine options. The markdown for node should use javascript as the language, so there is a small edit to `hooks-md.R` to check for that.

Example `.Rmd`:

```{r node-example0, engine="node"}
var foo = 42
console.log("The answer is ", foo);
```

```{r node-example1, engine="node", results="asis"}
var foo = 42
console.log("The answer is ", foo);
```

```{r node-example2, engine="node", results="hide"}
var foo = 42
console.log("The answer is ", foo);
```

```{r node-example3, engine="node", echo=FALSE}
var foo = 42
console.log("The answer is ", foo);
```

markdown:

```javascript
var foo = 42
console.log("The answer is ", foo);
```

```
## The answer is 42
```

```javascript
var foo = 42
console.log("The answer is ", foo);
```

The answer is 42

```javascript
var foo = 42
console.log("The answer is ", foo);
```

```
## The answer is 42
```