npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nexqloud-dcp/sdk

v0.2.3

Published

Universal TypeScript SDK for Nexqloud DCP services

Readme

Nexqloud DCP TypeScript SDK

npm version License: MIT

Official TypeScript/JavaScript SDK for Nexqloud DCP (Distributed Cloud Platform). Build, deploy, and manage cloud infrastructure with a type-safe, intuitive API.

Features

  • Fully typed - Complete TypeScript definitions for all API resources
  • Universal - Works in Node.js, Bun, Deno, edge runtimes, and browsers
  • Auto-generated - Always up-to-date with the latest API specification
  • Secure - Built-in security guardrails for sensitive operations
  • Modern - ESM and CommonJS support with tree-shaking
  • Resilient - Automatic retries and error handling

Installation

npm install @nexqloud-dcp/sdk

Or using your preferred package manager:

yarn add @nexqloud-dcp/sdk
pnpm add @nexqloud-dcp/sdk
bun add @nexqloud-dcp/sdk

Requirements

Quick Start

import { DCPClient } from '@nexqloud-dcp/sdk';

// Initialize the client
const dcp = new DCPClient({
  apiKey: process.env.DCP_API_KEY,
});

// List available node types
const nodeTypes = await dcp.nodeTypes.nodeTypesControllerFindAll();
console.log(nodeTypes);

Authentication

Set your API key as an environment variable:

export DCP_API_KEY=your_api_key_here

Or pass it directly when initializing:

const dcp = new DCPClient({
  apiKey: 'your_api_key_here',
});

Available Services

The SDK provides access to all DCP services through intuitive service clients:

| Service | Client | Description | | -------------- | --------------- | -------------------------------------- | | DC2 | dcp.dc2 | Virtual machines and compute instances | | DKS | dcp.dks | Kubernetes clusters | | DDS | dcp.dds | Managed databases | | DCR | dcp.dcr | Container registry | | DSS | dcp.dss | Object storage | | Node Types | dcp.nodeTypes | Available instance types | | Regions | dcp.regions | Available regions and metadata |

Usage Examples

List Available Node Types

// Get all available node types
const nodeTypes = await dcp.nodeTypes.nodeTypesControllerFindAll();

nodeTypes.forEach((nodeType) => {
  console.log(`${nodeType.label}: ${nodeType.vcpu} vCPU, ${nodeType.ram}GB RAM`);
});

Get Node Type Details

// Get details for a specific node type
const nodeType = await dcp.nodeTypes.nodeTypesControllerFindOne({
  nodeTypeId: 'standard-2c-4gb',
});

console.log(`CPU: ${nodeType.cpu.type} ${nodeType.cpu.frequency}`);
console.log(`Storage: ${nodeType.storage}GB`);

Create a Virtual Machine

// Create a new virtual machine
const vm = await dcp.dc2.virtualMachinesControllerCreate({
  name: 'my-app-server',
  nodeTypeId: 'standard-2c-4gb',
  regionId: 'us-east-1',
  osImageId: 'ubuntu-22.04',
  sshKeyIds: ['ssh-key-123'],
});

console.log(`VM created: ${vm.id}`);

List Virtual Machines

// List all virtual machines
const vms = await dcp.dc2.virtualMachinesControllerFindAll();

vms.data.forEach((vm) => {
  console.log(`${vm.name} (${vm.status}): ${vm.ipAddress}`);
});

Manage VM Lifecycle

const vmId = 'vm-123456';

// Start a VM
await dcp.dc2.virtualMachinesControllerStart({ id: vmId });

// Stop a VM
await dcp.dc2.virtualMachinesControllerStop({ id: vmId });

// Restart a VM
await dcp.dc2.virtualMachinesControllerRestart({ id: vmId });

// Delete a VM
await dcp.dc2.virtualMachinesControllerRemove({ id: vmId });

Create a Kubernetes Cluster

// Create a new Kubernetes cluster
const cluster = await dcp.dks.clustersControllerCreate({
  name: 'production-cluster',
  version: '1.28',
  regionId: 'us-west-2',
  nodePools: [
    {
      name: 'default-pool',
      nodeTypeId: 'standard-4c-8gb',
      minNodes: 2,
      maxNodes: 10,
    },
  ],
});

console.log(`Cluster created: ${cluster.id}`);

List Available Regions

// Get all available regions
const regions = await dcp.regions.metadataControllerGetRegions();

regions.forEach((region) => {
  console.log(`${region.name}: ${region.location}`);
});

Create a Managed Database

// Create a PostgreSQL database
const database = await dcp.dds.managedDatabasesControllerCreate({
  name: 'production-db',
  engine: 'postgresql',
  version: '15',
  nodeTypeId: 'db-standard-2c-4gb',
  regionId: 'eu-central-1',
});

console.log(`Database created: ${database.connectionString}`);

Object Storage Operations

// List storage buckets
const buckets = await dcp.dss.objectStorageControllerListBuckets();

// Create a new bucket
const bucket = await dcp.dss.objectStorageControllerCreateBucket({
  name: 'my-app-assets',
  regionId: 'us-east-1',
});

Container Registry

// List container images
const images = await dcp.dcr.containerRegistryControllerListImages();

// Create a new repository
const repo = await dcp.dcr.containerRegistryControllerCreateRepository({
  name: 'my-app',
  visibility: 'private',
});

Error Handling

The SDK throws typed errors for different scenarios:

import { DCPClient } from '@nexqloud-dcp/sdk';

try {
  const vm = await dcp.dc2.virtualMachinesControllerFindOne({
    id: 'non-existent-id',
  });
} catch (error) {
  if (error.statusCode === 404) {
    console.error('VM not found');
  } else if (error.statusCode === 401) {
    console.error('Authentication failed - check your API key');
  } else {
    console.error('An error occurred:', error.message);
  }
}

Advanced Configuration

Timeouts and Retries

const dcp = new DCPClient({
  apiKey: process.env.DCP_API_KEY,
  timeoutInSeconds: 60,
  maxRetries: 3,
});

Custom Headers

const dcp = new DCPClient({
  apiKey: process.env.DCP_API_KEY,
  headers: {
    'X-Custom-Header': 'value',
  },
});

Custom Fetch Implementation

import fetch from 'node-fetch';

const dcp = new DCPClient({
  apiKey: process.env.DCP_API_KEY,
  fetch: fetch as any,
});

Security Considerations

Browser Runtime Protection

Sensitive infrastructure operations are automatically blocked in browser environments and throw DCPSecurityError. Always call infrastructure management methods from a secure backend.

// Safe: Read-only operations in browser
const nodeTypes = await dcp.nodeTypes.nodeTypesControllerFindAll();

// Blocked: Write operations in browser (throws DCPSecurityError)
await dcp.dc2.virtualMachinesControllerCreate({ ... });

API Key Management

  • Never commit API keys to version control
  • Use environment variables or secure secret management
  • Rotate API keys regularly
  • Use API keys with minimal required permissions

TypeScript Support

The SDK is written in TypeScript and provides complete type definitions:

import type { VmResponseDto, NodeTypeResponseDto } from '@nexqloud-dcp/sdk';

const vm: VmResponseDto = await dcp.dc2.virtualMachinesControllerFindOne({
  id: 'vm-123',
});

const nodeType: NodeTypeResponseDto = await dcp.nodeTypes.nodeTypesControllerFindOne({
  nodeTypeId: 'standard-2c-4gb',
});

Documentation

Contributing

Contributions are welcome! Please see our Contributing Guide for details.

Support

License

This project is licensed under the MIT License - see the LICENSE file for details.

Changelog

See CHANGELOG.md for release history and updates.


Made by Nexqloud