Socket
Socket
Sign inDemoInstall

@nikitajs/core

Package Overview
Dependencies
Maintainers
0
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nikitajs/core

Provides the Nikita engine and the core Nikita actions and plugins.


Version published
Maintainers
0
Created
Source

Nikita "core" package

The core package provides the Nikita engine and the core Nikita actions and plugins.

Documentation

The Nikita website covers:

  • The API created by this package
  • several guides to learn the Foundamental concepts.
  • The actions registered in this package.

Architecture

The package is composed of:

  • The core engine:
    • The package entry point to instantiate Nikita sessions loaded with plugins and which register the actions present in this package.
    • The session module which is the internal engine.
    • The registry module to associate action names to modules.
    • The scheduler to orchestrate the execution of actions and their children.
    • The register script to register the package's actions.
  • Foundamental actions covering:
    • Basic actions such as assert, call and wait.
    • Execute actions to interact with Unix commands and process.
    • SSH related actions.
    • Filesystem related actions.
  • Plugins which extends Nikita in various ways such as:
    • Assertions to validate action behavior.
    • Conditions to enable and disable action execution.
    • Metadata to modify action's behaviors.
    • Tools to provide usefull data and functions to actions.

Usage

Nikita is commonly imported by refering to the nikita package. However, it will load a lot of actions which are potentially not necessary. By using the core package directly, you reduce your dependencies and the number of modules loaded in your Node.js process.

To import the module:

import nikita from "@nikitajs/core";

Then, call the register scripts to register additionnal actions, for example the incus actions:

import "@nikitajs/incus/lib/register";

Following this example, you can now use any action present in the core and the incus packages:

// Use the `execute` action from the `core` package
const {
  stdout: whoami
} = await nikita.execute('whoami', { trim: true });
// Use the `incus.init` action from the `incus` package
nikita.incus.init({
  image: 'images:alpine/3.13',
  container: `nikita-${whoami}`
});

Keywords

FAQs

Package last updated on 27 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc