Kudu API Wrapper for Node.js

1.4.1 · abandoned · verified Wed Apr 22

The `kudu-api` package provides a Node.js wrapper for interacting with the Kudu REST API, a service primarily used within Azure App Service environments for managing deployments, executing commands, and accessing the file system. With its current stable version at 1.4.1, the package simplifies programmatic interactions by offering distinct modules for source control, command execution, virtual file system operations, zip archive handling, and deployment management. It abstracts away direct HTTP request handling, providing a callback-based interface for common Kudu operations. As indicated by its last publish date approximately ten years ago and lack of recent activity on its GitHub repository, the project appears to be abandoned, with no active development or planned releases. This means it primarily targets CommonJS environments and older Node.js versions, and users should be aware of potential compatibility issues with modern JavaScript ecosystems.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to initialize the Kudu API client and perform basic operations like getting SCM info, executing a command, and listing files in the virtual file system.

const kudu = require('kudu-api')({
  website: process.env.KUDU_WEBSITE ?? 'your-website-name',
  username: process.env.KUDU_USERNAME ?? '$your-deployment-username',
  password: process.env.KUDU_PASSWORD ?? 'your-deployment-password'
});

kudu.scm.info(function(err, info) {
  if (err) {
    console.error('Error getting SCM info:', err);
    return;
  }
  console.log('SCM Info:', info);
});

kudu.command.exec("echo %CD%", function(err, result) {
  if (err) {
    console.error('Error executing command:', err);
    return;
  }
  console.log('Command Output:', result.Output);
});

kudu.vfs.listFiles("site", function(err, files) {
  if (err) {
    console.error('Error listing VFS files:', err);
    return;
  }
  console.log('Files in site folder:', files.map(f => f.name));
});

// Note: For real usage, ensure environment variables KUDU_WEBSITE, KUDU_USERNAME, KUDU_PASSWORD are set.

view raw JSON →