1.0.1 • Published 8 months ago
max-string v1.0.1
max-string
max-string
is a lightweight utility library that provides predefined maximum lengths for common
data types and formats. This package simplifies your workflow for database schema validation,
frontend form validation, and backend API validation. The values are derived from widely recognized
international standards, ensuring accuracy and reliability.
📦 Installation
Install the package:
npm install max-string
yarn add max-string
pnpm add max-string
🌐 Use Cases
- Frontend Form Validation: Add constraints to input fields based on predefined maximum lengths.
- Backend API Validation: Validate incoming data payloads to meet expected length requirements. 3Database Schema Validation: Ensure your string column lengths are properly defined to avoid truncation.
📘 Usage
import { MAX_STRING } from 'max-string';
console.log(MAX_STRING.PHONE_NUMBER); // 15