Skip to content

The Dependency Management endpoints let scripts inspect the packages that ship with the Hoody runtime, verify whether all required modules are available for a given script, and install missing npm packages on demand. Use these endpoints when a script needs to pre-flight its environment before execution or when the user wants to add libraries beyond the bundled set.

Returns the list of npm packages that ship with the Hoody runtime. Each entry reports whether the package is available so callers can decide whether to install additional modules or warn the user before execution.

This endpoint takes no parameters.

Terminal window
curl -X GET https://api.hoody.com/api/v1/exec/dependencies/bundled \
-H "Authorization: Bearer <token>"

Inspects a script’s source code or a comma-separated list of module names and reports which packages are already installed and which are missing. The response indicates whether additional installations are required before the script can run safely.

NameTypeRequiredDescription
codestringNoScript source code to scan for require and import statements
modulesstringNoComma-separated list of module names to check (e.g. "lodash,axios,dayjs")
Terminal window
curl -X POST https://api.hoody.com/api/v1/exec/dependencies/check \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"code": "const _ = require(\"lodash\");\nconst axios = require(\"axios\");",
"modules": "lodash,axios,dayjs"
}'

Installs one or more npm modules into the script runtime. Pass a single spec ("lodash" or "axios@1.6.2") or an array of specs to install several packages in sequence. Use the force flag to reinstall modules that are already present instead of having them reported as already-installed.

NameTypeRequiredDescription
modulesstring | arrayYesOne npm module spec (e.g. "lodash", "axios@1.2.3") or an array of specs. Array form installs every module in sequence.
forcebooleanNoWhen true, reinstall modules that are already present instead of reporting them as already-installed. Default: false.
Terminal window
curl -X POST https://api.hoody.com/api/v1/exec/dependencies/install \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"modules": ["lodash", "axios@1.6.2", "dayjs"],
"force": false
}'