# interpolate

> A simple interpolate function

Latest version **0.1.0** (published 2013-12-01) · 0 weekly downloads

## Install

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

## 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.1.0 |
| Published | 2013-12-01 |
| First published | 2013-12-01 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.6.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Gilles Ruppert |
| Maintainers | gillesruppert |
| Keywords | utilities, interpolate |

## Links

- npm: https://www.npmjs.com/package/interpolate
- Repository: https://github.com/gillesruppert/node-interpolate
- Issues: https://github.com/gillesruppert/node-interpolate/issues
- npm.io page: https://npm.io/package/interpolate

## Recent versions

- 0.1.0 (latest) — 2013-12-01

## README

interpolate - Simple JavaScript string interpolation
====================================================

A simple interpolate function for JavaScript. It is just based on simple RegExp 
and `String#replace` so mostly useful when you have simple use cases and want
something quick and dirty. Don't use it as a template tool unless it really is 
just something tiny.

usage
-----

```javascript
var interpolate = require('interpolate');
var result = interpolate('{greeting}! I am {name}.', {
  greeting: 'Hello',
  name: 'Gilles'
});

console.log(result); // 'Hello! I am Gilles.'
```

You can change the delimiter from the simple `{` `}` to something else, such as 
`{{` `}}` or `<%` `%>`.
Just pass in the new delimiter in the options.
**N.B. the start and end delimiter need to have the same
length.**

```javascript
var interpolate = require('interpolate');
var result = interpolate('<%greeting%>! I am <%name%>.', {
  greeting: 'Hello',
  name: 'Gilles'
}, { delimiter: '<%%>' });

console.log(result); // 'Hello! I am Gilles.'
```

See tests for some more advanced usage, i.e. with arrays, objects, etc.


install
-------
you can install `interpolate` with

```
   npm install interpolate
```

tests
-----
To run the tests, you need to run `npm install` in the root of the module.

Either run `make` or `npm test` to run the tests and see the spec.


Release notes:
0.1.0 - initial release

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