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

@dgpholdings/backend-mono

v1.0.26

Published

We will need the following

Downloads

83

Readme

Development setup

We will need the following

  • Docker installed in local system for containerization. Use docker version to check installation
  • Kubernetes Installed through Docker GUI to use the docker container for deployment. User kubectl version to check installation.
  • ingress-nginx installed which acts as a bridge between Kubernetes cluster and outside world + load balancing + routing configuration.
  • We need to update our system hosts file with an entry 127.0.0.1 ensloka.dev. For MacOs /etc/hosts and for Windows: C:\Windows\System32\Drivers\etc\hosts

Start Server

  • In terminal from the project root- skaffold dev or npm run dev
  • Now you can access https://ensloka.dev/api-authentication/ping If youre blocked due to certificate, you try by clicking anywhere on the browser tab and type thisisunsafe

Npm package @dgpholdings/backend-mono

This package returns typescript types for the front-end app to use the api contracts

To publish update:

  1. Commit all changes in the repo
  2. npm run pub

Docker basic usage

  1. docker build -t <docker-userId>/<service-name> . Note the [. dot in th end is imp] to build an image
  2. docker push <docker-userId>/<service-name> next push the image to DockerHub, for the k8s deployment to pull down this image for creating a pod.

Some handy Kubernetes commands

  1. kubectl apply -f some.yml this will run any yml script for kubernetes
  2. kubectl get services to list running services
  3. kubectl get pods to list running pods
  4. kubectl describe pod <name> describes a pod
  5. kubectl delete svc <name> to delete a service
  6. kubectl exec -it <pod-name> sh to get inside the file system of a pod
  7. kubectl port-forward <pod-name> 8001:8001 to quickly expose a running pod (in k8s cluster) listening on port 8001 to the outside world

Setting ENVIRONMENT_VARIABLE in Kubernetes

  • Example:
    • kubectl create secret generic <object-name-ref> --from-literal=NODE_ENV=development --from-literal=COUNTRY=de
    • There are other ways and options to set environment variables too
  • In our app we are setting env variable through
    1. First an entry in .dev.env file and then
    2. In server-depl.yaml file the same env entries in env: scope
  • Then we can do kubectl get secrets to list all the secret objects in the cluster
  • Now in the *-depl.yaml file of the pod where we want to access the environment variable and fo the following
    ...
    spec:
      containers:
        - name: auth
          image: austin4silvers/auth

          env: ## <== here we are making new entry
            - name: NODE_ENV
              valueFrom:
                secretKeyRef:
                  name: <the-object-name-ref>
                  key: NODE_ENV

Steps to update an image used by a deployment (for PRODUCTION)

  1. Create a depl-someservice.yml and make sure we are using :latest tag by default in the pod spec section of the yml file (when specifying the image: austin4silvers/auth)
  2. Make an update to your code in the service
  3. Build the image of the service
  4. Push image to the DockerHub
  5. run kubectl rollout restart deployment <deployment_name>

Steps to update an image used by a deployment (for DEVELOPMENT) using "Skaffold"

Using Skaffold because. (~/skaffold.yml houses the configuration)

  1. It will watch for changes in /infra/* directory for changes, then it will automatically apply to our k8s cluster
  2. It will watch for any changes in any our services code, and then sync the changes with their respective containers running inside the cluster
    skaffold dev // from the root of the project to start skaffold
    kubectl get pods // to check if all the deployed pods are "Running" (in a different terminal)

Development Notes

  1. To emit any error as response, use Error classes that extends BaseError. For example: throw new ErrorGeneral("...) is ✅. But throw new Error("..) is ❌.

Troubleshooting:

  • For error: {"errorMessage": ""}, check your request body, its probably an invalid json.