snap-validate
Version:
Zero-dependency, ~4KB validation library for common patterns. CJS + ESM, Standard Schema support, no TypeScript compiler required.
112 lines (111 loc) • 3.15 kB
JSON
{
"name": "snap-validate",
"version": "0.4.4",
"description": "Zero-dependency, ~4KB validation library for common patterns. CJS + ESM, Standard Schema support, no TypeScript compiler required.",
"main": "src/index.js",
"types": "types/index.d.ts",
"typings": "types/index.d.ts",
"exports": {
".": {
"types": "./types/index.d.ts",
"import": "./esm/index.mjs",
"require": "./src/index.js"
},
"./package.json": "./package.json"
},
"scripts": {
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage",
"lint": "eslint src tests",
"lint:fix": "eslint src tests --fix",
"format": "prettier --write \"src/**/*.js\" \"esm/**/*.mjs\" \"tests/**/*.js\"",
"prepare": "husky",
"prepublishOnly": "npm test && npm run lint && npm run test:esm",
"test:esm": "node --input-type=module -e \"import { validators, toStandardSchema } from './esm/index.mjs'; if (!validators.email('a@b.com').validate().isValid) throw new Error('esm smoke failed'); if (toStandardSchema((v) => validators.email(v))['~standard'].version !== 1) throw new Error('standard schema smoke failed'); console.log('ESM smoke test passed');\"",
"build": "echo 'No build step required for this library'",
"example": "node examples/basic-usage.js",
"type-check": "tsc --noEmit",
"test-types": "tsc test-types.ts --noEmit",
"validate-types": "tsc --noEmit && echo 'TypeScript definitions are valid!'",
"lint-types": "eslint types/**/*.ts",
"check-exports": "node -e \"console.log(Object.keys(require('./src/index.js')))\""
},
"keywords": [
"validation",
"validator",
"lightweight",
"zero-dependencies",
"standard-schema",
"esm",
"snap",
"quick",
"fast",
"email",
"phone",
"credit-card",
"url",
"password",
"forms",
"input-validation",
"schema-validation",
"pattern-matching"
],
"author": "Ramachandra Anirudh Vemulapalli",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/aniru-dh21/snap-validate.git"
},
"bugs": {
"url": "https://github.com/aniru-dh21/snap-validate/issues"
},
"homepage": "https://github.com/aniru-dh21/snap-validate#readme",
"overrides": {
"js-yaml": "4.2.0"
},
"devDependencies": {
"@babel/core": "^7.24.0",
"@babel/preset-env": "^7.24.0",
"@eslint/js": "^10.0.0",
"@types/jest": "^30.0.0",
"babel-jest": "^30.4.1",
"eslint": "^10.0.0",
"globals": "^17.0.0",
"husky": "^9.1.0",
"jest": "^30.4.2",
"lint-staged": "^15.2.0",
"prettier": "^3.2.0"
},
"files": [
"src/",
"esm/",
"types/",
"README.md",
"LICENSE"
],
"engines": {
"node": ">=18.0.0"
},
"jest": {
"testEnvironment": "node",
"collectCoverageFrom": [
"src/**/*.js",
"!src/**/*.test.js"
],
"coverageThreshold": {
"global": {
"branches": 80,
"functions": 80,
"lines": 80,
"statements": 80
}
}
},
"lint-staged": {
"*.js": [
"eslint --fix",
"prettier --write"
]
}
}