# @drubin/client-node

> NodeJS client for kubernetes

Latest version **0.7.1-rc1** (published 2018-11-05) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @drubin/client-node
pnpm add @drubin/client-node
yarn add @drubin/client-node
bun add @drubin/client-node
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.7.1-rc1 |
| Published | 2018-11-05 |
| First published | 2018-10-30 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 12 |
| Unpacked size | 4.6 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2275 |
| Author | Kubernetes Authors |
| Maintainers | drubin |
| Keywords | kubernetes, client |

## Links

- npm: https://www.npmjs.com/package/@drubin/client-node
- Repository: https://github.com/kubernetes-client/javascript
- Homepage: https://github.com/kubernetes-client/javascript#readme
- Issues: https://github.com/kubernetes-client/javascript/issues
- npm.io page: https://npm.io/package/@drubin/client-node

## Dependencies (12)

- [ws](https://npm.io/package/ws.md) ^6.1.0
- [execa](https://npm.io/package/execa.md) ^1.0.0
- [tslib](https://npm.io/package/tslib.md) ^1.9.3
- [byline](https://npm.io/package/byline.md) ^5.0.0
- [base-64](https://npm.io/package/base-64.md) ^0.1.0
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.12.0
- [request](https://npm.io/package/request.md) ^2.88.0
- [shelljs](https://npm.io/package/shelljs.md) ^0.8.2
- [bluebird](https://npm.io/package/bluebird.md) ^3.5.2
- [jsonpath](https://npm.io/package/jsonpath.md) ^1.0.0
- [underscore](https://npm.io/package/underscore.md) ^1.9.1
- [isomorphic-ws](https://npm.io/package/isomorphic-ws.md) ^4.0.1

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 0.7.1-rc1 (latest) — 2018-11-05
- 0.7.1 — 2018-10-30

## README

# Javascript Kubernetes Client information

[![Build Status](https://travis-ci.org/kubernetes-client/javascript.svg?branch=master)](https://travis-ci.org/kubernetes-client/javascript)
[![Client Capabilities](https://img.shields.io/badge/Kubernetes%20client-Silver-blue.svg?style=flat&colorB=C0C0C0&colorA=306CE8)](http://bit.ly/kubernetes-client-capabilities-badge)
[![Client Support Level](https://img.shields.io/badge/kubernetes%20client-beta-green.svg?style=flat&colorA=306CE8)](http://bit.ly/kubernetes-client-support-badge)


The Javascript clients for Kubernetes is implemented in
[typescript](https://typescriptlang.org), but can be called from either
Javascript or Typescript.

For now, the client is implemented for server-side use with node
using the `request` library.

There are future plans to also build a jQuery compatible library but
for now, all of the examples and instructions assume the node client.

# Installation
```sh
$ npm install @kubernetes/client-node
```

# Example code

## List all pods
```javascript
const k8s = require('@kubernetes/client-node');


const kc = new k8s.KubeConfig();
kc.loadFromDefault();

const k8sApi = kc.makeApiClient(k8s.Core_v1Api);

k8sApi.listNamespacedPod('default')
    .then((res) => {
        console.log(res.body);
    });
```

## Create a new namespace
```javascript
const k8s = require('@kubernetes/client-node');

const kc = new k8s.KubeConfig();
kc.loadFromDefault();

const k8sApi = kc.makeApiClient(k8s.Core_v1Api);

var namespace = {
  metadata: {
    name: 'test'
  }
};

k8sApi.createNamespace(namespace).then(
  (response) => {
    console.log('Created namespace');
    console.log(response);
    k8sApi.readNamespace(namespace.metadata.name).then(
      (response) => {
        console.log(response);
        k8sApi.deleteNamespace(
          namespace.metadata.name, {} /* delete options */);
      });
  },
  (err) => {
    console.log('Error!: ' + err);
  }
);
```

# Additional Examples
There are several more examples in the [examples](https://github.com/kubernetes-client/javascript/tree/master/examples) directory.

# Development

All dependencies of this project are expressed in its
[`package.json` file](package.json). Before you start developing, ensure
that you have [NPM](https://www.npmjs.com/) installed, then run:

```console
npm install
```

## (re) Generating code

```
cd ../
git clone https://github.com/kubernetes-client/gen
cd javascript
../gen/openapi/typescript.sh src settings
```

# Testing

Tests are written using the [Chai](http://chaijs.com/) library. See
[`config_test.ts`](./config_test.ts) for an example.

To run tests, execute the following:

```console
npm test
```

## Contributing

Please see [CONTRIBUTING.md](CONTRIBUTING.md) for instructions on how to contribute.

---
_Source: https://npm.io/package/@drubin/client-node · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
