All Products
Search
Document Center

Configure a dependency

Last Updated: May 31, 2022

Darabonba SDK for Node.js uses the main API-based logic to process parameters, send requests, and process return values. You can make API requests by installing the SDK of an Alibaba Cloud service as a dependency. You can download dependent modules and save the modules in the package.json file.

$ npm install @alicloud/ecs20140526 -S
$ npm install @alicloud/openapi-client -S

You can replace ecs-20140526 in the preceding code with the Alibaba Cloud service that you want to use. The Darabonba SDK of each Alibaba Cloud service can be queried in the SDK repository. For more information, visit SDK repository. The following code provides an example on how to configure Darabonba SDK of Elastic Compute Service (ECS) for Node.js as a dependency in JavaScript:

const { default: Client } = require('@alicloud/ecs20140526');
const { Config } = require('@alicloud/openapi-client');

The following code provides an example on how to configure Darabonba SDK of ECS for Node.js as a dependency in TypeScript:

import Ecs20140526, * as $Ecs20140526 from '@alicloud/ecs20140526';
import OpenApi, * as $OpenApi from '@alicloud/openapi-client';