# eval-string-interpolation

> string interpolation with eval for node.js

Latest version **0.0.2** (published 2014-10-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install eval-string-interpolation
pnpm add eval-string-interpolation
yarn add eval-string-interpolation
bun add eval-string-interpolation
```

## 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.0.2 |
| Published | 2014-10-18 |
| First published | 2014-10-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | magicdawn |
| Maintainers | magicdawn |
| Keywords | string, interpolation, format, template |

## Links

- npm: https://www.npmjs.com/package/eval-string-interpolation
- Repository: git@github.com:magicdawn/eval-string-interpolation
- Homepage: https://github.com/magicdawn/eval-string-interpolation
- Issues: https://github.com/magicdawn/eval-string-interpolation/issues
- npm.io page: https://npm.io/package/eval-string-interpolation

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2014-10-18
- 0.0.1 — 2014-10-06

## README

#eval-string-interpolation

Ruby style string-interpolation for nodejs with `eval` function

#Install
	$ npm i eval-string-interpolation --save
	
#Usage
`var inter = require('eval-string-interpolation');`

`eval(inter( use_interpolation_string_here ))`

Example
```js
var inter = require('eval-string-interpolation');

var name = "zhangsan"
var age = 18

console.log(eval(inter("name = #{name} , age = #{age}")));
// name = zhangsan , age = 18
```

## String#inter
By default,it will define the `inter` property,so example above sames to
`console.log(eval("name = #{name} , age = #{age}".inter));`


##@ support
`#{ @name }` -> `this.name`
`#{ @['content-type'] }` -> `this['content-type']`


#Other Implations
- [Fomatto](https://github.com/BonsaiDen/Fomatto) use {} as placeholder
- [rssi](https://github.com/mvasilkov/rssi) 
- [string-interpolate](https://github.com/alexeyraspopov/string-interpolate)

Fomatto works like a formatter, rssi & string-interpolate looks like a template engine, I can do same work with ejs/jade/razor-tmpl

Or maybe you are looking for  a simple function that can process like
```js
some_func("name = #{name} , age = #{age}")
```
no way...

#License
the MIT License. Copyright 2014 `magicdawn<784876393@qq.com>`

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