{"id":46975571,"url":"https://github.com/spoonboy-io/morpheus-nodejs-task-plugin","last_synced_at":"2026-03-11T12:37:56.798Z","repository":{"id":37480091,"uuid":"505853282","full_name":"spoonboy-io/morpheus-nodejs-task-plugin","owner":"spoonboy-io","description":"Script Morpheus automation tasks in Node.js. Utilise the latest ECMA standards and NPM modules.","archived":false,"fork":false,"pushed_at":"2022-06-22T11:44:29.000Z","size":145,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-16T13:04:50.659Z","etag":null,"topics":["automation","morpheus","node","nodejs","plugin","task"],"latest_commit_sha":null,"homepage":"","language":"Groovy","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/spoonboy-io.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}},"created_at":"2022-06-21T13:23:09.000Z","updated_at":"2023-09-04T10:09:30.000Z","dependencies_parsed_at":"2022-09-14T12:20:51.803Z","dependency_job_id":null,"html_url":"https://github.com/spoonboy-io/morpheus-nodejs-task-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/spoonboy-io/morpheus-nodejs-task-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spoonboy-io%2Fmorpheus-nodejs-task-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spoonboy-io%2Fmorpheus-nodejs-task-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spoonboy-io%2Fmorpheus-nodejs-task-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spoonboy-io%2Fmorpheus-nodejs-task-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spoonboy-io","download_url":"https://codeload.github.com/spoonboy-io/morpheus-nodejs-task-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spoonboy-io%2Fmorpheus-nodejs-task-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30381025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T06:09:32.197Z","status":"ssl_error","status_checked_at":"2026-03-11T06:09:17.086Z","response_time":84,"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":["automation","morpheus","node","nodejs","plugin","task"],"created_at":"2026-03-11T12:37:55.510Z","updated_at":"2026-03-11T12:37:56.785Z","avatar_url":"https://github.com/spoonboy-io.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node.js Morpheus Task Plugin\n\n### Write Morpheus automation tasks in Node.js\n\n- Results of previous tasks are available in a `results` object variable as `key`:`value`\n- Node.js must be installed on the appliance\n- Modules must be installed on the appliance with the global flag `npm install -g modulename`\n- The Plugin needs to be configured with the absolute path to the Node installation in the plugin settings\n- Does not use Nashorn. Use modern Ecmascript syntax, dependent on the version of Node.js you install\n\n### Build\n\nYou should be able to build this locally using the included grade wrapper\n\n```\n./gradlew shadowJar     \n```\n\n### Setup\n\n1. Install the plugin on Morpheus\n2. Install Node.js on the Morpheus Appliance. I used NVM to install Node.js v16.5.1 LTS\n3. Discover the absolute path of your Node.js installation (mine was `/home/ollie/.nvm/versions/node/v16.15.1`)\n4. Visit the plugin settings (Admin \u003e Integrations \u003e Plugins) and edit the plugin settings to add the absolute path as shown below:- \n\u003cimg width=\"620\" alt=\"edit plugin settings\" src=\"https://user-images.githubusercontent.com/7113347/174819249-2c9ecd2f-e33e-4b52-a9d5-7da6bc02f580.png\"\u003e\n\n### Example\n\nIn this example, we want to use a simple Node.js script in Morpheus. The code requires an external package, Axios, a HTTP request library.\n\nThis is the code:-\n\n```Node.js\nconst axios = require('axios');\n\naxios.get('https://jsonplaceholder.typicode.com/users')\n  .then(res =\u003e {\n    const headerDate = res.headers \u0026\u0026 res.headers.date ? res.headers.date : 'no response date';\n    console.log('Status Code:', res.status);\n    console.log('Date in Response header:', headerDate);\n\n    const users = res.data;\n\n    for(user of users) {\n      console.log(`Got user with id: ${user.id}, name: ${user.name}`);\n    }\n  })\n  .catch(err =\u003e {\n    console.log('Error: ', err.message);\n  });\n```\n\nExternal modules need to be installed on the Morpheus appliance globally. Once installed the module can be used by all Morpheus Node.js tasks.\n\nTo install Axios globally we run this command:-\n\n`npm install -g axios`\n\nWe can now add the script to a Node.js task. The screenshot below shows it in Morpheus. \n\n\u003cimg width=\"1131\" alt=\"image\" src=\"https://user-images.githubusercontent.com/7113347/174821605-0760786e-656d-4c3a-9c76-0d1640288ca8.png\"\u003e\n\nNote how we split the require statements from the main code? This simplifies processing the script on the Morpheus side.\n\nNote also, how we prefix our call for the Axios package? See how `require('axios');` becomes `require('morpheus/axios');`? This tells the task plugin to use the globally installed version of the module, and allows us to differentiate it from core Node.js modules such as `http`\n\nRunning this task in Morpheus we should see the following task output:-\n\n\u003cimg width=\"1147\" alt=\"image\" src=\"https://user-images.githubusercontent.com/7113347/174825856-2b5cb056-ad69-4a80-980b-1aaca8340d7d.png\"\u003e\n\n### TODO\n- Make the Morpheus vars available to the task\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspoonboy-io%2Fmorpheus-nodejs-task-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspoonboy-io%2Fmorpheus-nodejs-task-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspoonboy-io%2Fmorpheus-nodejs-task-plugin/lists"}