New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

epochtalk-validator

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

epochtalk-validator

Validation module for epochtalk and epochcore

latest
npmnpm
Version
0.0.5
Version published
Weekly downloads
6
200%
Maintainers
1
Weekly downloads
 
Created
Source

Validator

Schema validation module for all Epoch Projects.

Installation

$ git clone git@github.com:epochtalk/validator
$ cd validator
$ npm install

Usage Example

Access predefined validation methods

var authValidator = require('validator').api.auth; // Access the auth validator within api

var credentials = {
  username: 'test_user',
  password: 'password'
};

var err = authValidator.login(credentials); // pass parameters in to validator

if(err) {
  // do error related things
}
else {
  // do success related things
}

Directly access predefined Joi Schema

var authSchemas = require('validator').api.auth.schema; // Access Auth Schema
var Joi = require('joi');

var credentials = {
  username: 'test_user',
  password: 'password'
};

var loginSchema = authSchema.login; // grab the auth login schema

var err = Joi.validate(credentials, loginSchema); // Manually call Joi.validate with schema

if(err) {
  // do error related things
}
else {
  // do success related things
}

FAQs

Package last updated on 25 Mar 2015

Did you know?

Socket

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.

Install

Related posts