From 1384497e92c7f47ae24abcecc0c1fa6a920ad709 Mon Sep 17 00:00:00 2001 From: Tiff Ting Date: Wed, 3 Jul 2013 16:57:25 -0500 Subject: [PATCH] Added installation instructions --- README.md | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 875a182..63eb9a0 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,21 @@ -jsoneval -======== +# jsoneval -Simple utility for evaluating JavaScript against a JSON object +**A simple utility for evaluating JavaScript against a JSON object.** - # Extracts the token definitions - $ c2013.sh fdefs |jsoneval 'input.contentTemplateTokens' |jsonpp +## Installing + +* Grab [c2013.sh](https://dev.bazaarvoice.com/svn/scratch/users/rmorgan/scripts/c2013.sh) and put it somewhere in your `PATH` +* Clone this repository, and add the directory to your `PATH` +* Install [jsonpp](https://github.com/jmhodges/jsonpp) +* Connect to the BV FULL VPN or be on the BV network + +## Usage + +This 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) {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 + +This extracts a specific feature from feature definitions: + + $ c2013.sh fdefs | jsoneval 'function findFeature(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