byContract
  • Welcome
  • Where to use it
  • Syntax Overview
  • Types
  • Custom Types
  • Combinations
  • Validation Exceptions
  • Custom Validators
  • Usage with React
  • Production Environment
Powered by GitBook
On this page

Where to use it

PreviousWelcomeNextSyntax Overview

Last updated 6 years ago

Was this helpful?

CtrlK
  • Node.js
  • Browser
  • ES6 Module / Webpack

Was this helpful?

Node.js

npm install bycontract
const { validate } = require( "bycontract" );
validate( 1, "number|string" );

Browser

<script src="dist/byContract.min.js"></script>
<script>
  const { validate } =  byContract;
  validate( 1, "number|string" );
</script>

ES6 Module / Webpack

npm install bycontract
import { validate } from "bycontract";
validate( 1, "number|string" );