Skip to content
Hoody.com

Manage package.json lifecycle inside an exec container: read, initialize, install, compare, update, and pin dependencies. These endpoints operate on the project root inside the container’s working directory and are most useful for CI flows, dependency audits, and reproducible builds.

Retrieve the current package.json and a summary of its dependencies, dev dependencies, and scripts.

GET /api/v1/exec/package/read

This endpoint takes no parameters.

Terminal window
curl -X GET "https://proj-abc123-cont-xyz789-exec-1.us-east-1.containers.hoody.icu/api/v1/exec/package/read" \
-H "Authorization: Bearer <token>"

Create a new package.json in the project root. Returns 409 if one already exists, unless force is set to true.

POST /api/v1/exec/package/init

This endpoint takes no parameters.

FieldTypeRequiredDefaultDescription
namestringNo"hoody-exec-project"Package name
versionstringNo"1.0.0"Package version
descriptionstringNo"Hoody Exec project"Package description
forcebooleanNofalseOverwrite an existing package.json
Terminal window
curl -X POST "https://proj-abc123-cont-xyz789-exec-1.us-east-1.containers.hoody.icu/api/v1/exec/package/init" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "my-exec-project",
"version": "0.1.0",
"description": "My exec project",
"force": false
}'

Apply incremental updates to package.json: add or change dependencies, replace scripts, set metadata, or remove specific keys. The endpoint returns the list of changes that were applied.

POST /api/v1/exec/package/update

This endpoint takes no parameters.

FieldTypeRequiredDescription
dependenciesstringNoJSON string of dependencies to merge into the dependencies block
scriptsstringNoJSON string of scripts to merge into the scripts block
metadataobjectNoTop-level metadata fields to set (e.g. author, license)
removestringNoDot-notation path of a key to remove from package.json
Terminal window
curl -X POST "https://proj-abc123-cont-xyz789-exec-1.us-east-1.containers.hoody.icu/api/v1/exec/package/update" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"dependencies": "{\"lodash\":\"^4.17.21\"}",
"scripts": "{\"lint\":\"eslint .\"}",
"metadata": {"author": "Hoody", "license": "MIT"},
"remove": "devDependencies.typescript"
}'

Install npm packages into the project. When called with no body, installs all declared dependencies. Returns 202 because installation runs asynchronously.

POST /api/v1/exec/package/install

This endpoint takes no parameters.

FieldTypeRequiredDefaultDescription
packagesarrayNoSpecific packages to install (e.g. ["lodash", "zod"]). If omitted, all declared dependencies are installed.
devbooleanNofalseAdd the packages to devDependencies instead of dependencies
savebooleanNotrueWrite the installed packages to package.json
forcebooleanNofalseForce reinstall even if a lockfile is present
Terminal window
curl -X POST "https://proj-abc123-cont-xyz789-exec-1.us-east-1.containers.hoody.icu/api/v1/exec/package/install" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"packages": ["lodash", "zod"],
"dev": false,
"save": true,
"force": false
}'

Compare the dependencies and devDependencies declared in package.json against the packages actually installed in node_modules. Returns a summary plus lists of missing, outdated, and extra packages.

POST /api/v1/exec/package/compare

This endpoint takes no parameters.

This endpoint accepts an optional request body with no defined fields.

Terminal window
curl -X POST "https://proj-abc123-cont-xyz789-exec-1.us-east-1.containers.hoody.icu/api/v1/exec/package/compare" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{}'

Rewrite ranges and tags in package.json to exact installed versions for reproducible builds. If every dependency is already pinned, the response reports no changes.

POST /api/v1/exec/package/pin

This endpoint takes no parameters.

FieldTypeRequiredDescription
packagesarrayNoSpecific packages to pin. If omitted, all declared dependencies are pinned.
Terminal window
curl -X POST "https://proj-abc123-cont-xyz789-exec-1.us-east-1.containers.hoody.icu/api/v1/exec/package/pin" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"packages": ["express", "zod"]
}'