open-index/open-npm huggingface dataset:
npm package: @pubgcorp/kubectl
Description: Kubernetes node client wrapper
Author: dalpark
Latest version: 1.2.1

# How to Use

#### 1. Implement `IKubeConfigFactory`
```typescript
class KubeconfigFactory implements IKubeconfigFactory {
    public async getKubeconfigs(): Promise<{ [name: string]: IKubeconfig }> {
        // TODO: Implement method making Dictionary<name, IKubeconfig> 
    }
}
```

#### 2. Create Kubectl Instance

-  General Version
    ```typescript
    const kubectl = new Kubectl(new KubeconfigFactory());
    ```
- Using `tsyringe` Version
  ```typescript
  // entrypoint of application
  container.register<Kubectl>(Kubectl, { useFactory: (c) => new Kubectl(c.resolve(KubeconfigFactory)) });
  ```
#### 3. Examples

- ##### Get Resource
    ```typescript
    export interface KubectlResponse {
        status: string;
        message: string;
        obj?: any;
    }
    ```
    ```typescript
    // clusterName is key of dictionary<name, K8sCluster>
    const result: KubectlResponse = await kubectl.targetCluster(clusterName).get(namespace, kind, name);
    ```
    for custom resource
    ```typescript
    // apiVersion means like kubernetes-client.io/v1
    const result: KubectlResponse = await kubectl.targetCluster(clusterName).get(namespace, kind, name, apiVersion);
    ```
- ##### Apply Resource
    ```typescript
    const K8sObjects = [{
        kind: 'Namespace',
        apiVersion: 'v1',
        metadata: {
            name: 'abcdefg',
            labels: {},
            annotations: {},
        }
    }]
    const result = await kubectl.targetCluster(clusterName).apply(k8sObjects);
    ```
- ##### Patch Resource
    if useJsonPatch is true, use object as json patch object, otherwise get target and merge with object.
    ```typescript
    const result = await kubectl.targetCluster(clusterName).patch(namespace, target, targetName, object, useJsonPatch);
    ```
npm package: @pubgcorp/node-xed
Description: nodejs binding for INTEL XED (The X86 Encoder Decoder)
Author: dirty49374
Latest version: 0.0.20221101

# node-xed
nodejs binding for INTEL XED (The X86 Encoder Decoder)

# usage

```javascript
const xed = require('node-xed');

var data = new Uint8Array([0xe9, 0xfb, 0xff, 0xff, 0xff]);
var addr = "0x7fffffff00000000";
var addrLen = 16;
var instructions = xed.disassemble(data, addr, addrLen);

console.log(instructions);

// result is
[ { asm: 'jmp 0x7fffffff00000000',
    addr: '0x7fffffff00000000',
    offset: 0,
    len: 5 } ]
```