# evaljson

> Eval embedded value in json. Useful to define message resource object.

Latest version **6.0.4** (published 2019-02-24) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 6.0.4 |
| Published | 2019-02-24 |
| First published | 2015-07-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 3 |
| Unpacked size | 49.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Taka Okunishi |
| Maintainers | okunishinishi |

## Links

- npm: https://www.npmjs.com/package/evaljson
- Repository: https://github.com/okunishinishi/node-evaljson
- Homepage: https://github.com/okunishinishi/node-evaljson#readme
- Issues: https://github.com/okunishinishi/node-evaljson/issues
- npm.io page: https://npm.io/package/evaljson

## Dependencies (3)

- [argx](https://npm.io/package/argx.md) ^4.0.0
- [asobj](https://npm.io/package/asobj.md) ^3.0.1
- [objnest](https://npm.io/package/objnest.md) ^5.0.4

## Recent versions

- 6.0.4 (latest) — 2019-02-24
- 6.0.3 — 2018-11-29
- 6.0.2 — 2018-08-13
- 6.0.1 — 2018-08-12
- 6.0.0 — 2018-08-09
- 5.1.0 — 2017-09-26
- 5.0.5 — 2017-09-26
- 5.0.4 — 2017-09-26
- 5.0.3 — 2017-09-26
- 5.0.2 — 2017-09-26
- 5.0.1 — 2017-09-17
- 4.1.7 — 2017-05-18
- 4.1.6 — 2017-04-25
- 4.1.5 — 2017-04-24
- 4.1.4 — 2017-03-31
- … 31 more at https://npm.io/package/evaljson/versions

## README

evaljson
==========

<!---
This file is generated by ape-tmpl. Do not update manually.
--->

<!-- Badge Start -->
<a name="badges"></a>

[![Build Status][bd_travis_shield_url]][bd_travis_url]
[![npm Version][bd_npm_shield_url]][bd_npm_url]
[![JS Standard][bd_standard_shield_url]][bd_standard_url]

[bd_repo_url]: https://github.com/okunishinishi/node-evaljson
[bd_travis_url]: http://travis-ci.org/okunishinishi/node-evaljson
[bd_travis_shield_url]: http://img.shields.io/travis/okunishinishi/node-evaljson.svg?style=flat
[bd_travis_com_url]: http://travis-ci.com/okunishinishi/node-evaljson
[bd_travis_com_shield_url]: https://api.travis-ci.com/okunishinishi/node-evaljson.svg?token=
[bd_license_url]: https://github.com/okunishinishi/node-evaljson/blob/master/LICENSE
[bd_codeclimate_url]: http://codeclimate.com/github/okunishinishi/node-evaljson
[bd_codeclimate_shield_url]: http://img.shields.io/codeclimate/github/okunishinishi/node-evaljson.svg?style=flat
[bd_codeclimate_coverage_shield_url]: http://img.shields.io/codeclimate/coverage/github/okunishinishi/node-evaljson.svg?style=flat
[bd_gemnasium_url]: https://gemnasium.com/okunishinishi/node-evaljson
[bd_gemnasium_shield_url]: https://gemnasium.com/okunishinishi/node-evaljson.svg
[bd_npm_url]: http://www.npmjs.org/package/evaljson
[bd_npm_shield_url]: http://img.shields.io/npm/v/evaljson.svg?style=flat
[bd_standard_url]: http://standardjs.com/
[bd_standard_shield_url]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg

<!-- Badge End -->


<!-- Description Start -->
<a name="description"></a>

Eval embedded value in json. Useful to define message resource object.

<!-- Description End -->




<!-- Sections Start -->
<a name="sections"></a>

<!-- Section from "doc/guides/01.Installation.md.hbs" Start -->

<a name="section-doc-guides-01-installation-md"></a>

Installation
-----

```bash
npm install evaljson --save
```

<!-- Section from "doc/guides/01.Installation.md.hbs" End -->

<!-- Section from "doc/guides/02.Usage.md.hbs" Start -->

<a name="section-doc-guides-02-usage-md"></a>

Usage
-----

```javascript
'use strict'

const evaljson = require('evaljson')

let locale = evaljson({
  keys: {
    NAME: 'My Awesome App'
  },
  titles: {
    WELCOME_TITLE: 'Welcome to #{keys.NAME}!', // Embed value with "#{some_value}" syntax.
    WHERE_WE_ARE: 'We are on $(hostname)' // Execute command with "$(command)" syntax

  }
  /* ... */
})

console.log(locale.titles.WELCOME_TITLE) // -> Welcome to My Awesome App!

````


<!-- Section from "doc/guides/02.Usage.md.hbs" End -->

<!-- Section from "doc/guides/03.API.md.hbs" Start -->

<a name="section-doc-guides-03-a-p-i-md"></a>

API
---

| Signature | Description |
| --------- | ----------- |
| evaljson(src) | Eval src, with self values as context. |
| evaljson(src, context) | Eval with self values with context. |



<!-- Section from "doc/guides/03.API.md.hbs" End -->


<!-- Sections Start -->


<!-- LICENSE Start -->
<a name="license"></a>

License
-------
This software is released under the [MIT License](https://github.com/okunishinishi/node-evaljson/blob/master/LICENSE).

<!-- LICENSE End -->

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