
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
joi object schema validation with extensions - universal/isomorphic works with Node.js and is bundled for the browser
joi object schema validation with extensions as universal/isomorphic libarary for Node.js and bundled for the browser (babelified and bundled). Includes joi-date-extensions.
There has been some difficulty in getting a reasonable version of Joi packaged for the browser both due to the size of bundling and with Joi 7.x.x switching to ES6 modules has added additional challenges.
I made a browser build of joi available at joi-browser, but Joi@10 split date functionality into its own package joi-date-extensions, so I also created joi-date-extensions-browser but currently are having trouble when combining joi-browser and joi-date-extensions together.
In the meantime, this build was created which includes joi and joi-date-extensions and works on Node.js and provides a bundle for brower builds.
Moment is a peer dependency so it needs to be installed as well.
npm install joi-full moment
var Joi = require('joi-full'); // includes joi-date-extensions
Note: if you are using webpack with a babel loader you may need to exclude joi-full from being run through babel again.
In your webpack.config.js loaders, add an exclude: [ /joi-full/ ]
The joi-full package.json includes the browser field which directs browser builds to use to the prebuilt dist/joi-full.js
An example of using joi-full with webpack is in examples/webpack-basic
npm install joi-full moment
You might need to add the following to your app's webpack.config.js to enable the package aliasing we configured in package.json
resolve: {
packageAlias: 'browser'
}
Note: if you are using webpack with a babel loader you may need to exclude joi-full from being run through babel again.
In your webpack.config.js loaders, add an exclude: [ /joi-full/ ].
So in your code, you just require joi-full
var Joi = require('joi-full'); // includes joi-date-extensions
You can also use browserify to use joi-full. It should pick up the proper bundled file when it reads joi-full/package.json browser field.
npm install joi-full moment
So in your code, you just require joi-full
var Joi = require('joi-full'); // includes joi-date-extensions
There is an example in examples/browserify-basic.
There are three examples:
To use any of them:
cd examples/___
npm install
npm start
# builds dist/joi-full.js and dist/joi-full.min.js
npm install
npm run prepublish # when you want to rebuild
The main discussion about these difficulties has been in this github issue.
https://github.com/hapijs/joi/issues/528#issuecomment-128532221
See joi-browser for more details on the bundling issues.
Since this package is simply a bundling of the original joi and joi-date-extensions, please discuss defects or suggestions for those packages at:
FAQs
joi object schema validation with extensions - universal/isomorphic works with Node.js and is bundled for the browser
The npm package joi-full receives a total of 184 weekly downloads. As such, joi-full popularity was classified as not popular.
We found that joi-full demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.