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

@lomray/microservice-helpers

v2.18.0

Published

Package contains helpers for easy build and test microservices based on NodeJS & inverted json.

Downloads

677

Readme

NodeJS Microservices helpers for microservices

npm GitHub

Quality Gate Status Reliability Rating Security Rating Vulnerabilities Lines of Code Coverage

COMMON ENVIRONMENTS:

  • NODE_ENV - Can be production or development or tests. Default: development
  • ENVIRONMENT - Extra environment name. Default: prod
  • MS_CONNECTION - Invert json host and port (with protocol). Default: http://127.0.0.1:8001
  • MS_CONNECTION_SRV - Invert json connection it is SRV record. Default: false
  • MS_NAME - Microservice name. Default: authentication
  • MS_WORKERS - Microservice queue workers count. Default: 5
  • MS_ENABLE_REMOTE_MIDDLEWARE - Enable remote middleware feature. Set 0 to disable. Default: 1 (enabled)
  • MS_REMOTE_CONFIG_ENABLE - Enable remote config (get from configuration microservice). Set 0 to disable. Default: 1
  • MS_CONFIG_NAME - Configuration microservice name. Default: configuration
  • ENABLE_EVENTS - Enable events if microservice support it. Default: 0
  • MS_GRAFANA_LOKI_CONFIG - Grafana loki config. Default: null
  • MS_ENABLE_GRAFANA_LOG - Enable grafana loki log (config from configuration ms). Default: 0
  • MS_OPENTELEMETRY_ENABLE - Enable opentelemetry tracers. Default: 0
  • MS_DISABLE_OPENTELEMETRY_TRACES - Disable opentelemetry traces. Default: 0
  • MS_DISABLE_OPENTELEMETRY_METRICS - Disable opentelemetry metrics. Default: 0
  • MS_OPENTELEMETRY_OTLP_URL - Custom opentelemetry OTLP exporter URL. Default: undefined
  • MS_OPENTELEMETRY_OTLP_URL_SRV - Custom opentelemetry OTLP URL it is SRV record. Default: 0
  • MS_OPENTELEMETRY_DEBUG - Enable debug log opentelemetry. Default: 0
  • MS_CONSOLE_LOG_LEVEL - Change console log level, see all levels. Default: info

COMMON ENVIRONMENTS - DB SUPPORT:

  • DB_URL - Database url connection string. Default: undefined. Please use URL or credentials.
  • DB_HOST - Database host. Default: 127.0.0.1
  • DB_PORT - Database port. Default: 5432
  • DB_USERNAME - Database user name. Default: postgres
  • DB_PASSWORD - Database password. Default: example
  • DB_DATABASE - Database name. Default: ms-microservice-name
  • DB_FROM_CONFIG_MS - Get DB credentials from configuration microservice. Set 0 to disable. Default: 1

COMMON ENVIRONMENTS - AWS SUPPORT:

  • AWS_ACCESS_KEY_ID - AWS access key ID. Default: undefined
  • AWS_SECRET_ACCESS_KEY - AWS secret access key. Default: undefined
  • AWS_REGION - AWS region. Default: undefined
  • AWS_BUCKET_NAME - AWS S3 bucket name. Default: undefined
  • AWS_BUCKET_ACL - AWS S3 bucket ACL (e.g.: public-read). Default: undefined
  • AWS_FROM_CONFIG_MS - Get AWS credentials from configuration microservice. Set 0 to disable. Default: 1

COMMON ENVIRONMENTS - FIREBASE SUPPORT:

  • FIREBASE_CREDENTIAL - Firebase credential JSON string. Default: {}
  • FIREBASE_FROM_CONFIG_MS - Get firebase credential from configuration microservice. Set 0 to disable. Default: 1

This package contains:

  • Entities
    • IJson Query filter
  • Mocks
    • Typeorm
    • Typeorm extension
  • Helpers
    • Launchers (with/without db)
    • Create DB connection
    • Get common microservices constants (see list ENVIRONMENT)
    • Get entity columns (EntityColumns)
    • Redact secrets for console outputs
    • Resolve SRV records
    • Tracer
  • Services
    • API Client (make requests to another microservices)
    • CRUD
    • Log
    • Microservice metadata
    • Remote config
    • Firebase SDK
  • Class validator: extra validators
  • Test helpers
  • Instrumentations for collect metrics

See microservices for example of usage.