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

@kotaicode/kubeconfig-utils

v1.1.0

Published

A TypeScript library for managing Kubernetes kubeconfig files

Readme

kubeconfig-utils-ts

CI npm version Documentation License: MIT

A TypeScript library for managing Kubernetes kubeconfig files. This library provides a simple and type-safe way to manipulate kubeconfig files programmatically.

Features

  • Type-safe kubeconfig manipulation
  • Runtime validation using Zod
  • Comprehensive test coverage
  • Full TypeScript support
  • Detailed documentation

Installation

npm install kubeconfig-utils

Usage

Basic Usage

import { KubeconfigEditor } from 'kubeconfig-utils';

// Create an editor instance with a kubeconfig
const editor = new KubeconfigEditor(kubeconfigYaml);

// Chain operations
const finalKubeconfig = editor
  .mergeWith(anotherKubeconfigYaml)
  .deduplicate()
  .renameContext("old-name", "new-name")
  .setContextNamespace("context-name", "namespace")
  .setCurrentContext("context-name")
  .toString();

Merging Multiple Configs

import { KubeconfigEditor } from 'kubeconfig-utils';
import * as fs from 'fs';

// Load multiple kubeconfig files
const configs = [
  fs.readFileSync('~/.kube/config', 'utf8'),
  fs.readFileSync('prod-config.yaml', 'utf8'),
  fs.readFileSync('staging-config.yaml', 'utf8')
];

// Merge all configs and organize them
const finalConfig = new KubeconfigEditor(configs[0])
  .mergeWith(configs[1])
  .mergeWith(configs[2])
  .deduplicate()
  .renameContext('minikube', 'local-dev')
  .renameContext('prod-cluster', 'production')
  .setContextNamespace('production', 'prod')
  .setCurrentContext('production')
  .toString();

// Save the merged config
fs.writeFileSync('merged-config.yaml', finalConfig);

Filtering and Organizing

import { KubeconfigEditor } from 'kubeconfig-utils';

// Load a kubeconfig with multiple clusters
const editor = new KubeconfigEditor(kubeconfigYaml);

// Keep only production contexts and organize them
const prodConfig = editor
  .filterContextsByClusterName('prod-cluster')
  .renameContext('prod-cluster', 'production')
  .setContextNamespace('production', 'prod')
  .removeContext('unused-context')
  .toString();

Documentation

For detailed documentation, visit https://kotaicode.github.io/kubeconfig-utils-ts/

Contributing

Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Release Process

This project uses release-it for automated versioning, changelog generation, and GitHub releases. Publishing to npm is handled by GitHub Actions.

How to create a new release

  1. Ensure your working directory is clean and on the main branch.
  2. Run the release script:
    npm run release
    • This will prompt for the next version, update the changelog, commit, tag, push, and create a GitHub release.
  3. Wait for GitHub Actions to publish to npm:
    • The publish.yml workflow will automatically publish the package to npm when a new GitHub release is created.
  4. Verify the release:

Requirements

  • You must have push access to the repository.
  • The NPM_TOKEN secret must be set in the repository settings for npm publishing.
  • The GITHUB_TOKEN is provided automatically by GitHub Actions.