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 🙏

© 2024 – Pkg Stats / Ryan Hefner

slask-up

v0.2.3

Published

Configures a Kubernetes deployment with a GitHub Action using JavaScript/TypeScript

Downloads

6

Readme

slask-up and github slask-action

Deploy scripted kubernetes applications without dependencies

if you need to test the action without github actions you can use npx slask-up deploy.cjs '{"sha":"1231234"}' last parameter is the github context if that is used in the deployment file, f.ex. git sha and it's not needed.

variables can be set with npx slask-up deploy.cjs sha=1231234

Config and basic secrets

configurations and secrets can be also be used, first store with npx slask-up set key value or npx slask-up set-secret key value

to override config file use --secrets-file=filename and to override default encryption key --secrets-key=32byte-key

Conversion helper

to convert your yaml deployments to json/slask deployments you can try https://yaml-converter.knatofs.se/

Deploy with github actions

example action.yaml:

jobs:
  slask:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: Deploy scripted application
      uses: matst80/slask-action@main
      with:
        k8sConfig: ${{ secrets.K8S_CONFIG }}
        scriptPath: deploy.cjs

then the deployment script file /deploy.cjs

/** @type {import('slask-up').DeploymentConfig} */
module.exports = async (k8s, { sha }) => {
  const namespace = "default";
  const labels = { app: "example" };

  await k8s.createDeployment(namespace, {
    metadata: {
      name: "example",
      labels,
    },
    spec: {
      replicas: 1,
      selector: {
        matchLabels: labels,
      },
      template: {
        metadata: {
          labels,
        },
        spec: {
          containers: [
            {
              name: "converter",
              image: `example:${sha}`,
              imagePullPolicy: "Always",
              ports: [
                {
                  containerPort: 8080,
                },
              ],
              resources: {
                requests: {
                  memory: "40Mi",
                },
              },
            },
          ],
        },
      },
    },
  });
  await k8s.createService(namespace, {
    metadata: {
      name: "example",
    },
    spec: {
      selector: labels,
      ports: [
        {
          port: 8080,
        },
      ],
    },
  });
  await k8s.createIngress(namespace, {
    metadata: {
      name: "example",
    },
    spec: {
      ingressClassName: "nginx",
      rules: [
        {
          host: "example.local",
          http: {
            paths: [
              {
                path: "/",
                pathType: "Prefix",
                backend: {
                  service: {
                    name: "example",
                    port: {
                      number: 8080,
                    },
                  },
                },
              },
            ],
          },
        },
      ],
    },
  });
};