npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@slimio/installer

v0.5.0

Published

SlimIO Agent and Addons installer

Readme

Installer

version Maintenance MIT dep size known vulnerabilities Build Status Greenkeeper badge

SlimIO Agent and Addons installer. We use this package in:

  • the CLI to install and clone the agent and all addons.
  • Tcp-SDK for testing the communication with the Socket addon.

This package has been designed to be used by Addons to achieve clean unit-testing (by re-cloning a complete agent).

Requirements

Getting Started

This package is available in the Node Package Repository and can be easily installed with npm or yarn.

$ npm i @slimio/installer
# or
$ yarn add @slimio/installer

Usage example

Clone a SlimIO agent (what we do for example in the Tcp-Sdk test suite).

const installer = require("@slimio/installer");
const treekill = require("tree-kill");

async function main() {
    const agentDir = process.cwd();
    await installer.initAgent(agentDir, { name: "agent" });

    // Start the SlimIO Agent his child process
    const cp = await installer.runAgent(agentDir, true);

    try {
        // Do your work here...
    }
    finally {
        treekill(cp.pid);
    }
}
main().catch(console.error);

Or install SlimIO Addons in a valid SlimIO Agent directory.

const installer = require("@slimio/installer");

// CONSTANTS
const kAddonsToInstall = ["cpu", "MySQL"];

async function main() {
    const agentDir = process.cwd();

    await Promise.allSettled(
        kAddonsToInstall.map((addonName) => installer.installAddon(addonName, agentDir))
    );
}
main().catch(console.error);

API

This method will extract and install all required (built-in) addons for a SlimIO Agent.

interface InitOptions {
    token?: string;
    name?: string;
    forceClean?: boolean;
}

By default forceClean is equal to true (this mean that the code will try to remove any agent on the system!).

Run a given SlimIO Agent in a dedicated Node.js child process. Return the process Read Stream.

Install the dependencies of a given Node.js project directory (it spawn a Node.js process to run the npm install / npm ci command). This command only install production dependencies (devDependencies are ignored).

The current working dir value is process.cwd().

Found the real addon name in the SlimIO manifest file and rename the directory name (because by default the directory name is the one from github which is a bad thing). This method is automatically used in installAddon.

By default value of the fileName argument is slimio.toml. The current working dir value is process.cwd().

Download the Agent archive on github (or extract a recent version stored in cache for performance). This method is used by initAgent.

interface ExtractOptions {
    downloadFromRemote?: boolean;
    token?: string;
    name?: string;
}

By default downloadFromRemote is equal to true.

Install one Addon at the given destination (which must be a valid SlimIO Agent path).

interface InstallOptions {
    installDependencies?: boolean;
    searchInRegistry?: boolean;
    token?: string;
}

By default the dependencies of the addon will be installed. The searchInRegistry default value is false.

await installAddon("SlimIO.Socket", "./myAgent");
await installAddon("YourGithubOrg.AddonName", "./myAgent");
await installAddon("Alerting", "./myAgent"); // Same as SlimIO.Alerting
await installAddon("https://github.com/SlimIO/Aggregator", "./myAgent");

Parse an Addon installation expression. The function try to guess the Organization and the Repository name by itself, if there is no org then it will return SlimIO as the default org. The returned payload is described by the following TypeScript interface:

interface ExprResult {
    repoUserOrg: string;
    repoName: string;
    host: null | string;
}

Current supported host are github.com and gitlab.com.

parseAddonExpr("https://github.com/SlimIO/Socket"); // { repoUserOrg: "SlimIO", repoName: "Socket", host: "github.com" }
parseAddonExpr("Socket"); // { repoUserOrg: "SlimIO", repoName: "Socket", host: null }
parseAddonExpr("Foo/Socket"); // { repoUserOrg: "Foo", repoName: "Socket", host: null }

Configure the default registry URL used under the hood by the Registry SDK package.

CONSTANTS

The list of builtin addons can be retrieved with the CONSTANTS object.

const { CONSTANTS } = require("@slimio/installer");

console.log(CONSTANTS.BUILT_IN_ADDONS);

Dependencies

|Name|Refactoring|Security Risk|Usage| |---|---|---|---| |@slimio/github|Minor|Medium|Download and extract github repositories| |@slimio/gitlab|Minor|Medium|Download and extract gitlab repositories| |@slimio/manifest|Minor|Low|Read, Write and manage SlimIO manifest| |@slimio/registry-sdk|Minor|Low|SlimIO Registry SDK| |tar-fs|Minor|High|fs bindings for tar-stream|

License

MIT