This package has been deprecated

Author message:

Deprecated. Use @malijs/metadata

mali-metadata

0.1.0 • Public • Published

mali-metadata

Mali metadata middleware

npm version build status

API Reference

mali-metadata

Mali metadata middleware. If the call has metadata with the specified property the specified type the middleware function is executed.

Param Type Description
name String The name of the metadata object property
options Options
options.truthy Boolean optional check for truthiness on the param value within the request. Default: false
fn function The middleware function to execute

Example

const metadata = require('mali-metadata')

async function requestId (requestId, ctx, next) {
  ctx.req.requestId = requestId
  await next()
}

app.use(metadata('requestId', { truthy: true }, requestId))

License

Apache-2.0

Package Sidebar

Install

npm i mali-metadata

Weekly Downloads

1

Version

0.1.0

License

Apache-2.0

Last publish

Collaborators

  • bojand