open-index/open-npm huggingface dataset:
npm package: @nwt/conductor-client
Description: JavaScript Client for Netflix Conductor
Author: Conductor community
Latest version: 1.0.4

Conductor node client
---

This is a node.js client for [Netflix](https://github.com/Netflix/conductor) and [Orkes](https://orkes.io/) Conductor.

## Quickstart

```javascript
const {TaskClient, TaskManager} = require('@conductor-sdk/conductor-client')

const client = new TaskClient({
  // or wherever Conductor is running locally
  baseURL: 'http://localhost:8080'
})

const worker = {
  taskDefName: "simple_worker",
  execute: async ({ inputData }) => {
    return {
      outputData: {
        ...inputData,
        "hello": "From your worker"
      },
      status: "COMPLETED"
    }
  }
}

const workers = [worker]
const taskManager = new TaskManager(
  client,
  workers
)

taskManager.startPolling()
```

## Development

```shell
# .node-version file contains necessary version of node
# ensure that you are using a compatible version
# Install dependencies
npm i

# run tests
npm test

# lint
npm run lint

# lint and autofix
npm run lint:fix
```


### Releasing [work in progress]

TODO: we need to add shared credentials for the `@orkes` org

Publication is currently manual. 

```shell
npm test
npm publish
```
npm package: @nwt/conductor-javascript
Description: Typescript Client for Netflix Conductor
Author: Conductor community
Latest version: 0.0.4

# Conductor Javascript SDK

This project provides client SDKs to interact with [Netflix](https://conductor.netflix.com/) and [Orkes](https://orkes.io/) conductor servers.

## Quick Start

1. [Setup](#Setup-conductor)
2. [Create and run Task Workers](docs/worker/README.md)
3. [Create workflows using Code](docs/workflow/README.md)
4. [Api Docs](docs/api/README.md)

### Setup conductor

Simple connection to conductor

```typescript
const client = new ConductorClient({
  serverUrl: "https://play.orkes.io/api",
});

```
#### Using TLS

The client uses `node-fetch` which supports node.js's [`httpsAgent` options](https://nodejs.org/api/https.html#new-agentoptions). For example:

```typescript
import {Agent} from "https"
import {ConductorClient} from "@io-orkes/conductor-typescript";

const agentOptions = {
  key: "<buffer>",
  cert: "<buffer>",
  ca: "<buffer>",
  servername: 'play.orkes.io',
  // ...
}

const client = new ConductorClient({
  serverUrl: 'https://play.orkes.io/api',
  AGENT: new Agent(agentOptions)
})

const taskManager = new TaskManager(client, [ /* workers */ ])
taskManager.startPolling()
```

#### Connect to conductor using Orkes

```typescript

/**
 * Application keys generated from the Application menu > Create Application
 * then edit and create Access Keys
 *
 */
import { OrkesApiConfig, orkesConductorClient } from "@io-orkes/conductor-typescript";

const config: Partial<OrkesApiConfig> = {
  keyId: "XXX",
  keySecret: "XXXX",
  serverUrl: "https://play.orkes.io/api",
};

orkesConductorClient(config).then(client => ..... );

```