{"id":20079618,"url":"https://github.com/transpect/javascript-extension","last_synced_at":"2026-05-08T06:03:23.854Z","repository":{"id":93859545,"uuid":"81558606","full_name":"transpect/javascript-extension","owner":"transpect","description":"An extension step for XML Calabash to run JavaScript and NodeJS in XProc","archived":false,"fork":false,"pushed_at":"2018-03-20T14:13:28.000Z","size":18078,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-13T01:14:05.829Z","etag":null,"topics":["calabash","javascript","nodejs"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/transpect.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2017-02-10T11:22:03.000Z","updated_at":"2023-03-20T14:44:55.000Z","dependencies_parsed_at":"2023-03-09T20:30:27.679Z","dependency_job_id":null,"html_url":"https://github.com/transpect/javascript-extension","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transpect%2Fjavascript-extension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transpect%2Fjavascript-extension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transpect%2Fjavascript-extension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transpect%2Fjavascript-extension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/transpect","download_url":"https://codeload.github.com/transpect/javascript-extension/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241509657,"owners_count":19974071,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["calabash","javascript","nodejs"],"created_at":"2024-11-13T15:23:44.556Z","updated_at":"2026-05-08T06:03:23.666Z","avatar_url":"https://github.com/transpect.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# javascript-extension\n\nAn extension step for XML Calabash to run JavaScript and NodeJS in XProc\n\n## Description\n\nThis step runs JavaScript code either by reading it from the input port or from a reference to an external file.\n\n```xml\n\u003ctr:javascript\u003e\n  \u003cp:with-option name=\"href\" select=\"'test.js'\"/\u003e\n\u003c/tr:javascript\u003e\n\n```\n\n```xml\n\u003ctr:javascript\u003e\n  \u003cp:inline\u003e\n    \u003cc:data\u003e\n      print('hello world')\n    \u003c/c:data\u003e\n  \u003c/p:inline\u003e\n\u003c/tr:javascript\u003e\n\n```\n\nThe step implements the JavaScript engines [Rhino](https://github.com/mozilla/rhino) from Mozilla and [Nashorn](https://docs.oracle.com/javase/8/docs/technotes/guides/scripting/nashorn/) from Oracle and the [trireme](https://github.com/apigee/trireme) library from Apigee for running node.js scripts inside the JVM.\n\n## Requirements\n\n* Java 1.8\n\n## XML Calabash Configuration\n\n* add the path to `JavaScriptExtension.java` and the jar files in the `lib directory` to your Java classpath\n* edit your XProc config and add the class file\n\n```xml\n\u003cxproc-config xmlns=\"http://xmlcalabash.com/ns/configuration\" \n  xmlns:tr=\"http://transpect.io\"\u003e\n\n  \u003cimplementation type=\"tr:javascript\" class-name=\"JavaScriptExtension\"/\u003e\n    \n\u003c/xproc-config\u003e\n\n```\n\n### Limitations\n\nNodeJS code is just executed with Trireme and Rhino. Trireme doesn't support the newer JavaScript engine Nashorn. Please also note that there are differences between the JavaScript implementation of Rhino and NodeJS. There is a detailed [list of supported features](http://mozilla.github.io/rhino/compat/engines.html) from Mozilla.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftranspect%2Fjavascript-extension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftranspect%2Fjavascript-extension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftranspect%2Fjavascript-extension/lists"}