@protomodule/probe
v0.6.0
Published
Convenience module to integrate protomodule compatible features into NodeJS/express app.
Downloads
329
Maintainers
Readme
⚛️ Protomodule | Probe
for NodeJS / Express based applications
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:
- Specific environment variables overwrite
- Options as parameters (parameters are merged from first to last)
- 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.