{"id":30141996,"url":"https://github.com/solzimer/jsexpr","last_synced_at":"2026-02-27T20:13:51.529Z","repository":{"id":39786659,"uuid":"136759750","full_name":"solzimer/jsexpr","owner":"solzimer","description":"String and JSON expression interpolator and evaluator. Interpolates or evaluates a string against a json object, or transforms an object into another based on a json template.","archived":false,"fork":false,"pushed_at":"2025-05-09T09:44:12.000Z","size":1422,"stargazers_count":2,"open_issues_count":10,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-11T05:31:57.483Z","etag":null,"topics":["evaluation","expression","expression-evaluator","expression-parser","interpolation","json","string"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/solzimer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-06-09T21:34:19.000Z","updated_at":"2025-05-09T09:44:16.000Z","dependencies_parsed_at":"2025-05-09T10:35:11.068Z","dependency_job_id":null,"html_url":"https://github.com/solzimer/jsexpr","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/solzimer/jsexpr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solzimer%2Fjsexpr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solzimer%2Fjsexpr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solzimer%2Fjsexpr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solzimer%2Fjsexpr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solzimer","download_url":"https://codeload.github.com/solzimer/jsexpr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solzimer%2Fjsexpr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29911552,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"ssl_error","status_checked_at":"2026-02-27T19:37:41.463Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["evaluation","expression","expression-evaluator","expression-parser","interpolation","json","string"],"created_at":"2025-08-11T05:21:26.714Z","updated_at":"2026-02-27T20:13:51.511Z","avatar_url":"https://github.com/solzimer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jsexpr\nJSON Expressions!\n\n[![Build Status](https://travis-ci.org/solzimer/jsexpr.svg?branch=master)](https://travis-ci.org/solzimer/jsexpr)\n\nString and JSON expression interpolator and evaluator. Interpolates or evaluates a string against a json object, or transforms an object into another based on a json template.\n\n## Installation\n```\nnpm install jsexpr\n```\n\n## String Evaluation\n```javascript\nconst expression = require(\"jsexpr\");\n\nvar fn = expression.fn(\"(${host}=='mymachine' || ${host}=='yourmachine') \u0026\u0026 ${appName}=='su'\");\n\n// Result: false\nvar result = fn({host:\"mymachine\",appName:23});\n```\n\n## String Interpolation\n```javascript\nconst expression = require(\"jsexpr\");\n\nvar expr = expression.expr(\"/var/${date}/${client.address}/file.log\");\n\n// Result: /var/2017-01-01/localhost/file.log\nvar result = expr({date:\"2017-01-01\",client:{address:\"localhost\"}});\n```\n\n## Object Interpolation\n```javascript\nconst expression = require(\"jsexpr\");\n\nvar jsexpr = expression.expr({\n\ttime : \"${client}/${address.host}:${address.port}\",\n\tdata : {\n\t\trequest : {\n\t\t\theaders : \"${headers}\"\n\t\t}\n\t}\n});\n\nvar result = jsexpr({\n\tclient : \"HOST001\",\n\taddress : {\n\t\thost : \"localhost\",\n\t\tport : 8080\n\t},\n\theaders : \"Content-Type: application/json\"\n});\n```\n\n### Object Interpolation Result\n```javascript\n{\n\ttime: 'HOST001/localhost:8080',\n\tdata: {\n\t\trequest: {\n\t\t\theaders: 'Content-Type: application/json'\n\t\t}\n\t}\n}\n```\n\n### JSON Stringify\n```javascript\nvar input1 = {client : \"HOST001\", address : {host : \"localhost\", port : 8080}, headers : \"Content-Type: application/json\"};\n\nlet jxpr1 = expr.expr(\"${JSON}\");\nlet jxpr2 = expr.expr(\"${JSON:address}\");\nlet jxpr3 = expr.expr(\"${JSON:address:0}\");\nlet jxpr4 = expr.expr(\"${JSON:0}\");\n\n// =\u003e\n\n{\n  \"client\": \"HOST001\",\n  \"address\": {\n    \"host\": \"localhost\",\n    \"port\": 8080\n  },\n  \"headers\": \"Content-Type: application/json\"\n}\n\n{\n  \"host\": \"localhost\",\n  \"port\": 8080\n}\n\n{\"host\":\"localhost\",\"port\":8080}\n\n{\"client\":\"HOST001\",\"address\":{\"host\":\"localhost\",\"port\":8080},\"headers\":\"Content-Type: application/json\"}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolzimer%2Fjsexpr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolzimer%2Fjsexpr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolzimer%2Fjsexpr/lists"}