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 🙏

© 2026 – Pkg Stats / Ryan Hefner

sla-wizard-plugin-sla-generator

v1.0.1

Published

This is a sla-wizard plugin designed to generate SLAs using a CSV file

Readme

SLA Generator Plugin

A plugin for SLA Wizard that generates multiple SLA files from a CSV file containing client information and a YAML template.

Overview

The SLA Generator Plugin automates the creation of Service Level Agreements (SLAs) for multiple clients. It is particularly useful when you have a list of clients in a CSV format and want to generate standard SLAs with unique, secure API keys for each.

Key features:

  • Batch Generation: Create hundreds of SLAs from a single CSV file.
  • Secure API Keys: Automatically generates SHA-256 hashed API keys for each client.
  • Key Preservation: When updating existing SLAs, the plugin preserves already generated keys.
  • Mapping Generation: Creates a JSON file mapping client emails to their generated API keys and SLA files.

Installation

This plugin is part of the SLA Wizard ecosystem. To use it, ensuring you have sla-wizard installed and this plugin is in your plugins directory.

# Install dependencies
npm install

Usage

CLI Usage

The plugin adds the generate-slas-csv command to the SLA Wizard.

node index.js generate-slas-csv -t <template-path> -c <csv-path> -o <out-dir> [options]

Example

node index.js generate-slas-csv \
  -t ./templates/base-sla.yaml \
  -c ./data/clients.csv \
  -o ./generated-slas \
  -m ./generated-slas/keys-mapping.json

Options

| Option | Description | Default | | :--- | :--- | :--- | | -t, --template <path> | Required. Path to the SLA template YAML file. | - | | -c, --csv <path> | Required. Path to the CSV file (must have an email column). | - | | -o, --outDir <path> | Required. Directory where the generated SLA files will be saved. | - | | -k, --keys <number> | Number of API keys to generate per client. | 4 | | -m, --mapping <path> | Path to the mapping JSON file to be created. | <outDir>/apikeys_mapping.json | | -e, --existing <dir> | Directory with existing SLAs to update (preserves keys). | - |

Programmatic Usage

You can also use the generation logic directly in your Node.js application:

const { generateSLAsFromCSV } = require('sla-wizard-plugin-sla-generator');

async function run() {
  const mapping = await generateSLAsFromCSV(
    './template.yaml',
    './clients.csv',
    './output',
    4,
    './output/mapping.json'
  );
  console.log('Generated SLAs for:', Object.keys(mapping));
}

CSV Format Requirements

The CSV file must contain at least an email column, which is used as a unique identifier for each client and to personalize the SLA id.

Example clients.csv:

name,email,company
John Doe,[email protected],Example Corp
Jane Smith,[email protected],Test Ltd

Generated Structure

When run, the plugin generates:

  1. Individual SLA files: sla_john_doe_example_com.yaml, etc.
  2. A mapping file: apikeys_mapping.json.
{
  "[email protected]": {
    "apikeys": ["hash1", "hash2", "hash3", "hash4"],
    "slaFile": "output/sla_john_doe_example_com.yaml"
  }
}