
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@shagital/adonisjs-phone-validator
Advanced tools
Adds phone number validation functionality to Adonisjs on the JS port of Google's libphonenumber API by catamphetamine
adonis install @shagital/adonisjs-phone-validator
// via npm
npm require @shagital/adonisjs-phone-validator
// via yarn
yarn add @shagital/adonisjs-phone-validator
Open start/app.js
and add @shagital/adonisjs-phone-validator/providers/PhoneValidatorProvider
to the providers
array
You use the phone
validation syntax just like you'd normally do validation in Adonisjs. Examples below:
NOTE: The country 2-character ISO code is required. You can find all supported codes here
//app/Controllers/Http/UserController
const { validate } = use('Validator')
class UserController {
async store ({ request, session, response }) {
const rules = {
phone: 'required|phone:NG', // validate Nigerian phone number
}
const validation = await validate(request.all(), rules)
if (validation.fails()) {
session
.withErrors(validation.messages())
return response.redirect('back')
}
return 'Validation passed'
}
}
//app/Validators/StoreUser.js
'use strict'
class StoreUser {
get rules () {
return {
phone: 'required|phone:US', // validate a US phone number
}
}
}
Free for all, if you find an issue with the package or think of an improvement, please send in a PR.
FAQs
Phone number validator for Adonisjs
The npm package @shagital/adonisjs-phone-validator receives a total of 0 weekly downloads. As such, @shagital/adonisjs-phone-validator popularity was classified as not popular.
We found that @shagital/adonisjs-phone-validator 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.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.