Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

middy-extractor

1.0.0 • Public • Published

middy-extractor

travis build

Middy middleware for connecting to redis. Complete documentation

Getting Started

Installing middy-extractor

npm install --save middy # You need middy installed 
npm install --save middy-extractor

Running the tests

npm test

Usage

const middyExtractor = require('middy-extractor')
const middy = require('middy')
 
const someHandler = (event, context, callback) => {
 
  // The redis instance is accessible from the event object
  let { gender, contentType }  = event.extr
  callback(null, gender + ' ' + contentType)
}
 
const handler = middy(someHandler)
  .use(middyExtractor({ extractions: {
    gender: 'requestContext.authorizer.claims.gender',
    contentType: 'headers.Content-Type',
  }, extractionDestKey: 'extr' })
 
module.exports = { handler }

Contributing

Feel free to open a Pull Request or Issue w/ a bug report or feature request.

install

npm i middy-extractor

Downloadsweekly downloads

2

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability