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

holy-cow-nodejs

v1.1.7

Published

*Note: Cluster bindings are missing for the holy cow group in gitlab so gitlab ci will fail to deploy, until this is resolved.* test

Downloads

2

Readme

Holycow node.js example project

Note: Cluster bindings are missing for the holy cow group in gitlab so gitlab ci will fail to deploy, until this is resolved. test

great contribution

Status of project:

  • [x] Build
    • [x] Use Kaniko
    • [x] One process per container
    • [x] Small images
  • [x] CI/CD
    • [x] Gitlab CI
  • [x] Healthchecks
    • [x] Format
      • [x] Readiness /ready
      • [x] Liveness /healthy
  • [x] Logging
    • [x] Format
      • [x] JSON
      • [x] Fields
  • [x] Monitoring
    • [x] Expose a /metrics endpoint
    • [x] Use existing libraries to expose your metrics
    • [x] Use your application port for your metrics endpoint if possible
    • [x] Follow the default prometheus naming conventions for your metrics
  • [x] API Docs
    • [x] Use OpenAPI
    • [x] Provide endpoint for swagger.json
    • [x] Provide swagger ui at /api-docs
  • [ ] Requests & Limits
  • [ ] Scaling
  • [ ] Security
    • [x] Use Helmet
  • [ ] Startup and Shutdown
  • [ ] Statelessness
  • [ ] Versioning

Steps used to create this project

  1. Create Repo in Gitlab & Clone

    git clone [email protected]:holycow/node.js.git

  2. Initialize package.json

    yarn init

  3. Add .gitignore and .editorconfig.

  4. Add ESlint for Linting

    yarn add eslint eslint-config-standard@"^17.0.0-1" eslint-plugin-promise eslint-plugin-import eslint-plugin-n --dev

  5. Define style guide for eslint by creating .eslintrc.json. We are using standard to save time by avoiding bikeshedding about code style.

    {
      "root": true,
      "env": {
        "node": true,
        "es2022": true
      },
      "extends": [
        "standard"
      ]
    }
  6. Add lint-staged and husky for linting in pre-commit hooks

    npx mrm@2 lint-staged

  7. Add following dependencies:

    yarn add express helmet pino-http dotenv-defaults @cloudnative/health-connect prometheus-api-metrics prom-client swagger-ui-express js-yaml

  8. Create .env.defaults file. Note: Only add safe to commit env defaults.

  9. Write the actual code in index.js. See comments in index.js to follow along.

Kubernetes

  1. Create own namespace (replace yournamespace with your namespace name)
kubectl create namespace yournamespace
  1. Set current namespace
kubectl config set-context --current --namespace=yournamespace
  1. Create registry secret
kubectl create secret docker-registry gitlab-registry-credentials --docker-server=registry.gitlab.open-xchange.com --docker-username=$GITLAB_USERNAME --docker-password=$GITLAB_TOKEN --dry-run=client -o yaml | kubectl apply -f -
  1. Create helm chart and amend templates
mkdir helm
helm create helm/nodejs

Gitlab CI

See comments in .gitlab-ci.yml.