Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
jsoneval
========

Simple utility for evaluating JavaScript against a JSON object
## Simple utility for evaluating JavaScript against a JSON object

# Extracts the token definitions
$ c2013.sh fdefs |jsoneval 'input.contentTemplateTokens' |jsonpp

# Extracts a specific feature from feature definitions:
$ c2013.sh fdefs |jsoneval 'function findFeature(id) {if (input.features) {return input.features[id];} var result; input.categories.forEach(function (category) {category.groups.forEach(function (group) {group.features.forEach(function (feature) {if (feature.id === id) {result = feature}})})}); return result}; findFeature("emailTemplatesEditor")' |jsonpp

## Install

```bash
git clone git@github.com:robbytx/jsoneval.git
cd jsoneval
npm install -g .
```
23 changes: 23 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "jsoneval",
"version": "1.0.0",
"description": "Eval JSON input",
"main": "jsoneval.js",
"bin": {
"jsoneval": "./jsoneval.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/robbytx/jsoneval.git"
},
"keywords": [
"json",
"eval"
],
"author": "Robby Morgan",
"license": "ISC",
"bugs": {
"url": "https://github.com/robbytx/jsoneval/issues"
},
"homepage": "https://github.com/robbytx/jsoneval#readme"
}