# render-in-place

> Render an ejs templated file

Latest version **1.0.2** (published 2018-06-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install render-in-place
pnpm add render-in-place
yarn add render-in-place
bun add render-in-place
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-06-17 |
| First published | 2018-06-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=6.0.0 |
| Dependencies | 2 |
| Unpacked size | 9.1 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jake Hamilton |
| Maintainers | jakehamilton |

## Links

- npm: https://www.npmjs.com/package/render-in-place
- Repository: https://github.com/jakehamilton/render-in-place
- Homepage: https://github.com/jakehamilton/render-in-place#readme
- Issues: https://github.com/jakehamilton/render-in-place/issues
- npm.io page: https://npm.io/package/render-in-place

## Dependencies (2)

- [ejs](https://npm.io/package/ejs.md) ^2.6.1
- [@types/node](https://npm.io/package/@types/node.md) ^10.3.3

## Recent versions

- 1.0.2 (latest) — 2018-06-17
- 1.0.1 — 2018-06-16
- 1.0.0 — 2018-06-16

## README

# 🎞 render-in-place

Render an [ejs](https://npmjs.com/package/ejs) templated file, overwriting it with the result.

# Usage

## Import

This module exposes a function as its `default` export.

### CommonJS

```javascript
const render = require('render-in-place').default;

render(...)
```

### TypeScript

With `allowSyntheticDefaultImports`

```typescript
import render from 'render-inplace';

render(...)
```

Without `allowSyntheticDefaultImports`

```typescript
import { default as render } from 'render-in-place';

render(...)

// or

import * as rip from 'render-in-place';

rip.render(...)
```

## Example

```typescript
import render from 'render-in-place';

render(
    '/path/to/template', // path to template file
    { data: { to: 'render' } }, // data passed to template
    {
        read: {}, // config passed to ejs reading file
        write: {}, // config passed to fs when writing file
    },
)
```

# Documentation

## `render(path: string, data: object, config: object)`

### `path`

The absolute path to your template file.

### `data`

Any data to pass off to the template when rendering. This 
value is provided directly to `ejs` when rendering your file.

### `config`

Extra configuration provided to `ejs.renderFile` or 
`fs.writeFile`.

#### `config.read`

Configuration passed to `ejs.renderFile`.

#### `config.write`

Configuration passed to `fs.writeFile`.

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