arb / celebrate

A joi validation middleware for Express.
MIT License
1.34k stars 65 forks source link

celebrate undefined #66

Closed BebeSparkelSparkel closed 6 years ago

BebeSparkelSparkel commented 6 years ago

The docs show to require celebrate like below:

// try-celebrate.js
const { celebrate, Joi, errors } = require('celebrate');
console.log('celebrate', celebrate);

terminal

$ node try-celebrate.js 
celebrate undefined

but celebrate is undefined. The below is what works for me to get the celebrate object:

const celebrate = require('celebrate')
const { Joi, errors } = celebrate
console.log('celebrate', celebrate)
arb commented 6 years ago

If you're using an old version of celebrate (which you are) you need to check the tagged version of the read me here.

BebeSparkelSparkel commented 6 years ago

npm update celebrate obviously not working Thanks!