
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
@bubojs/validation
Advanced tools
This route validation middleware is built around fatestValidator feel free to look at the documentation to learn more
You can use the typing provided by FastestValidator which allows you to create a typed schema for fastest ex :
const userCreateValidations: FastestValidator<User> = {
schema: {
$$async: true,
username: { type: 'string', min: 3, max: 255 },
email: { type: 'email', normalize: true },
password: this.passwordValidation,
birthDate: {
optional: true,
type: 'date',
convert: true
},
bio: { type: 'string', optional: true }
},
validatorOptions: {
useNewCustomCheckerFunction: true, // using new version
messages: {
// Register our new error message text
atLeastOneLetter: 'The pass value must contain at least one letter from a-z ranges!',
atLeastOneUpperCaseLetter: 'The pass value must contain at least one letter from A-Z ranges!',
atLeastOneDigit: 'The pass value must contain at least one digit from 0 to 9!',
atLeastOneSpecialCharacter: 'The pass value must contain at least one special character!',
emailNotAvailable: `The email is already registered!`
}
}
}
once the schema is created, it must be added to the route to be validated, there is a decorator for that:
import { Body, Controller, Post } from '@bubojs/api'
import { AuthMiddleware, ValidationMiddleware } from '@bubojs/catalog'
@Controller()
class AuthController {
@ValidationMiddleware(userCreateValidations)
@Post('/signup')
async signup(@Body() body: any) {
...
}
}
so the scheme is added to the route
FAQs
Unknown package
The npm package @bubojs/validation receives a total of 10 weekly downloads. As such, @bubojs/validation popularity was classified as not popular.
We found that @bubojs/validation demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.