Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Eval embedded value in json. Useful to define message resource object.
npm install evaljson --save
'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!
Signature | Description |
---|---|
evaljson(src) | Eval src, with self values as context. |
evaljson(src, context) | Eval with self values with context. |
This software is released under the MIT License.
FAQs
Eval embedded value in json. Useful to define message resource object.
The npm package evaljson receives a total of 470 weekly downloads. As such, evaljson popularity was classified as not popular.
We found that evaljson demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.