# nerdctl

> Node wrapper for nerdctl

Latest version **0.5.0** (published 2022-05-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install nerdctl
pnpm add nerdctl
yarn add nerdctl
bun add nerdctl
```

## Health

**Score 25/100 (F)** — status: abandoned.

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

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2022-05-06 |
| First published | 2022-04-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=16 |
| Dependencies | 4 |
| Unpacked size | 241.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 6 |
| Author | RoyLin |
| Maintainers | unhand |

## Links

- npm: https://www.npmjs.com/package/nerdctl
- Repository: https://github.com/ZhiXiao-Lin/nerdctl
- Homepage: https://github.com/ZhiXiao-Lin/nerdctl#readme
- Issues: https://github.com/ZhiXiao-Lin/nerdctl/issues
- npm.io page: https://npm.io/package/nerdctl

## Dependencies (4)

- [yaml](https://npm.io/package/yaml.md) ^2.0.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [node-fetch](https://npm.io/package/node-fetch.md) 2.6.6
- [change-case](https://npm.io/package/change-case.md) ^4.1.2

## Recent versions

- 0.5.0 (latest) — 2022-05-06
- 0.4.4 — 2022-05-06
- 0.4.3 — 2022-05-06
- 0.4.2 — 2022-05-06
- 0.4.1 — 2022-05-06
- 0.4.0 — 2022-05-05
- 0.3.8 — 2022-05-05
- 0.3.7 — 2022-05-05
- 0.3.6 — 2022-05-02
- 0.3.5 — 2022-05-02
- 0.3.4 — 2022-05-02
- 0.3.3 — 2022-05-02
- 0.3.2 — 2022-05-02
- 0.3.1 — 2022-05-02
- 0.3.0 — 2022-05-02
- … 21 more at https://npm.io/package/nerdctl/versions

## README

# Nerdctl

Node wrapper for nerdctl

# Install

```shell
yarn add nerdctl
```

# Useage

```ts
import { events, factory } from "nerdctl";

const IMAGE_NAME = "hello-world";
const CONTAINER_NAME = "hello";

const vm = factory();

vm.on(events.VM_INIT_START, () => {
  console.log("VM_INIT_START");
});
vm.on(events.VM_INIT_OUTPUT, (data) => {
  console.log(data);
});
vm.on(events.VM_INIT_END, () => {
  console.log("VM_INIT_END");
});
vm.on(events.IMAGE_PULL_START, () => {});
vm.on(events.IMAGE_PULL_OUTPUT, (data) => {
  console.log(data);
});
vm.on(events.IMAGE_PULL_END, (data) => {
  console.log(data);
});
vm.on(events.CONTAINER_RUN_OUTPUT, (data) => {
  console.log(data);
});

if (!(await vm.checkVM())) {
  await vm.initVM();
}

await vm.pullImage(IMAGE_NAME);

const images = await vm.getImages();
console.log(images);

await vm.run(IMAGE_NAME, { name: CONTAINER_NAME });
await vm.stop(CONTAINER_NAME);
await vm.remove(CONTAINER_NAME);
```

## License

Node nerdctl is [MIT licensed](LICENSE).

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