Skip to content

An NPM library to work with macadam from Node projects

License

Notifications You must be signed in to change notification settings

crc-org/macadam.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b04e7dc · Apr 18, 2025

History

25 Commits
Apr 18, 2025
Apr 18, 2025
Apr 8, 2025
Apr 18, 2025
Apr 8, 2025
Apr 18, 2025
Apr 18, 2025
Apr 18, 2025
Apr 18, 2025
Apr 18, 2025
Apr 18, 2025

Repository files navigation

macadam.js

An NPM library to work with macadam from Node projects

Installation

The library is published on GitHub NPM registry.

You need to indicate in .npmrc where is located the package, and you need to authenticate with a GitHub token (classic) having read:packages scope:

.npmrc

@crc-org:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=<TOKEN>

Then you can install the package for your project:

npm i @crc-org/macadam.js@latest

Usage

import * as macadamjs from '@crc-org/macadam.js';

const macadam = new macadamjs.Macadam('my-ext');
await macadam.init();
await macadam.createVm({
  imagePath: '/path/to/image.raw',
  username: 'core',
});
const vms = await macadam.listVms({});
console.log('==> vms', vms);

const startResult = await macadam.startVm({});
console.log('==> start', startResult);

const stopResult = await macadam.stopVm({});
console.log('==> stop', stopResult);

const rmResult = await macadam.removeVm({});
console.log('==> rm result', rmResult);

const vms0 = await macadam.listVms({});
console.log('==> vms after rm', vms0);