@protomodule/probe

Convenience module to integrate protomodule compatible features into NodeJS/express app.


Keywords
typescript, express, env, log, version, changelog, prometheus, metrics
License
Apache-2.0
Install
npm install @protomodule/probe@0.6.0

Documentation

⚛️ Protomodule | Probe

for NodeJS / Express based applications

NPM Version NPM Install Size NPM Downloads

Protomodule is a set of common practices which span from coding over CI/CD to production deployments. Every utility within Protomodule is able to provide core functionality as a standalone tool. All Protomodule utilities are interoperable to get the most out of your DevOps pipeline with minimum effort.

Probe is the NodeJS module to integrate Protomodules principles into NodeJS / Express based applications.

🚨 This library is under heavy development. Be sure to check back for breaking changes in future releases.

Quick start guide

Install Protomodule | Probe by running:

$ npm install --save @protomodule/probe

Integrate Protomodule | Probe into your express setup with a single line of code:

⚠️ Be aware: Add Protomodule | Probe before you add all your other routes/middlewares in order to function correctly. All routes/middlewares added before calling the Protomodule initializer are exluded from protomodules features.

import { useProtomoduleIn } from "@protomodule/probe"

const app = express()
useProtomoduleIn(app)

// Add your routes here

Features

Protomodule | Probe provides two kinds of features:

Modules

Modules are automatically applied middlewares for express. The may be deactivated by configuration.

Utilities

Must be explicitly used.

Configuration options

Modules can be configured in the useProtomoduleIn(...) call. First parameter of this function takes an Express app. Through the rest arguments an arbitrary number of options can be specified.

You can pass in plain objects or use predefined options imported from @protomodule/probe.

Be aware that all options are merged in the following priority:

  1. Specific environment variables overwrite
  2. Options as parameters (parameters are merged from first to last)
  3. Default fallback values

Example configuration

import { useProtomoduleIn, withoutRequestLogging } from "@protomodule/probe"

...
useProtomoduleIn(app, withoutRequestLogging)

Read more about available options in the options section.

How to contribute

Please use pull requests for new feature suggestions. During development run yarn watch to automatically re-compile on code changes. For releases to NPM run:

$ yarn build
$ yarn release

Credits

License

This project is licensed under the terms of the MIT license. See the LICENSE file.

This project is in no way affiliated with Apple Inc or Google Inc. This project is open source under the MIT license, which means you have full access to the source code and can modify it to fit your own needs.