Skip to content

The Dependency Management API lets you inspect which npm packages ship with the Hoody execution environment, audit a script’s require/import statements against that manifest, and install additional modules on demand. Use these endpoints to bootstrap scripts that rely on third-party libraries or to verify coverage before running untrusted code.

Returns the full catalog of npm modules that are pre-installed in the execution environment, along with an aggregate availability flag.

This endpoint takes no parameters.

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

Parses the supplied source code (or an explicit list of module specifiers) and reports which referenced modules are already bundled and which are missing. No modules are installed.

This endpoint takes no path, query, or header parameters.

NameTypeRequiredDescription
codestringNoSource code to scan for require/import references
modulesstringNoExplicit module specifier or comma-separated list to check
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 axios = require(\"axios\");\nconst _ = require(\"lodash\");"
}'

Installs one or more npm modules into the execution environment. Modules that are already present are reported as such unless force is set to true.

This endpoint takes no path, query, or header parameters.

NameTypeRequiredDescription
modulesstring | string[]YesOne 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.0"],
"force": false
}'