
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
input-sense
Advanced tools
Detects low-quality, fake, or placeholder user inputs beyond regex validation
A lightweight JavaScript utility that detects low-quality, fake, or placeholder user inputs that pass traditional regex validation.
It adds a human-intent layer on top of normal validation.
Most validation libraries focus on syntax, not intent.
Inputs like:
often pass validation even though they are meaningless.
input-sense helps detect such inputs early and improve overall data quality.
mode: "all")mode: "detailed")senseInputBatch)listRules)Using npm:
npm install input-sense
Using yarn:
yarn add input-sense
Using pnpm:
pnpm add input-sense
import { senseInput } from "input-sense";
const result = senseInput("qwerty");
if (result) {
console.log(result);
} else {
console.log("Input looks valid");
}
By default, input-sense returns only the first detected issue.
To get all detected issues, use mode: "all".
senseInput("aa", { mode: "all" });
Use mode: "detailed" to get back an array of { rule, message } objects.
This is useful when you want to show different UI feedback per rule.
senseInput("aaaa", { mode: "detailed" });
// [{ rule: "repeatedChar", message: "Input looks like repeated characters" }]
Use senseInputBatch to validate an entire form object in one call.
It accepts the same options as senseInput and applies them to every field.
import { senseInputBatch } from "input-sense";
senseInputBatch({
username: "aaaa",
email: "test",
bio: "Harshit"
});
// { username: "Input looks like repeated characters", email: "Input looks like a placeholder word", bio: null }
Works with all modes:
senseInputBatch({ username: "aaaa" }, { mode: "detailed" });
// { username: [{ rule: "repeatedChar", message: "Input looks like repeated characters" }] }
Use listRules to get all available rule names in execution order.
import { listRules } from "input-sense";
listRules();
// ["repeatedChar", "symbolOnly", "numericOnly", "placeholderWord", "repeatedWord",
// "minLength", "sequential", "reverseSequential", "keyboardPattern", "entropy", "lowVowelRatio"]
This is useful for validating your disable array before passing it to senseInput.
senseInput("aa", {
mode: "all",
disable: ["repeatedChar"]
});
You can fine-tune rules using the rules option.
senseInput("aaa", {
rules: {
repeatedChar: { threshold: 4 }
}
});
// null — only flags when 5+ repetitions (threshold + 1)
senseInput("mycustomword", {
rules: {
placeholderWord: { customWords: ["mycustomword"] }
}
});
// "Input looks like a placeholder word"
senseInput("qw", {
rules: {
keyboardPattern: { minLength: 5 }
}
});
// null — input is too short to check
senseInput("hey hey there", {
rules: {
repeatedWord: { maxAllowedRatio: 0.6 }
}
});
// null — duplication ratio is within the allowed limit
senseInput("bcdfgh", {
rules: {
lowVowelRatio: { minRatio: 0.1 }
}
});
// null — ratio threshold is relaxed
senseInput("hello", {
rules: {
minLength: { minLength: 6 }
}
});
// "Input is too short to be meaningful (minimum 6 characters)"
senseInput("abcdef", {
rules: {
entropy: { minLength: 6, minRatio: 0.9 }
}
});
senseInput("aa", {
mode: "all",
rules: {
minLength: { minLength: 5 },
entropy: { minLength: 6, minRatio: 0.6 }
}
});
| Mode | Returns | Use when |
|---|---|---|
"first" (default) | string | null | You only need the first blocking issue |
"all" | string[] | null | You want to show all issues at once |
"detailed" | { rule, message }[] | null | You need to know which rule fired |
| Rule | Config option | Type | Default | Description |
|---|---|---|---|---|
repeatedChar | threshold | number | 0 | Min repetitions before flagging |
placeholderWord | customWords | string[] | [] | Extra words to flag |
keyboardPattern | minLength | number | 3 | Min length before checking |
repeatedWord | maxAllowedRatio | number | 0 | Max allowed duplication ratio |
lowVowelRatio | minLength | number | 5 | Min length before checking |
lowVowelRatio | minRatio | number | 0.2 | Min vowel ratio required |
minLength | minLength | number | 4 | Min required input length |
entropy | minLength | number | 6 | Min length before checking |
entropy | minRatio | number | 0.6 | Min character diversity ratio |
All rules have safe defaults. Unknown rule names in rules config are safely ignored.
senseInput("aaaa");
// "Input looks like repeated characters"
senseInput("test");
// "Input looks like a placeholder word"
senseInput("1234");
// "Input looks like a sequential pattern"
senseInput("9876");
// "Input looks like a reverse sequential pattern"
senseInput("qwerty");
// "Input looks like a keyboard pattern"
senseInput("123456");
// "Input contains only numbers and looks non-meaningful"
senseInput("test test test");
// "Input contains repeated words and looks non-meaningful"
senseInput("bcdfgh");
// "Input has very low vowel presence and looks non-meaningful"
senseInput("Harshit");
// null
This project uses automated test coverage to ensure reliability. Coverage is collected and reported on every commit via CI. All 11 rule files maintain 100% coverage across statements, branches, functions, and lines.
Think of input-sense as an intent checker, not a validator.
It runs a series of small, focused rules to answer one question:
"Does this input look meaningful for a human?"
The library runs multiple checks in a fixed order and returns the first detected issue.
User Input
↓
Regex / Required Validation
↓
input-sense (intent detection)
↓
Backend Validation
This project is actively maintained. All core validation rules are covered by automated tests and enforced via CI.
| Use case | Recommendation |
|---|---|
| Simple forms | Default mode |
| Rich UX | mode: "all" |
| Rule-specific UX | mode: "detailed" |
| Full form validation | senseInputBatch |
| Strict apps | Enable entropy tuning |
| JS projects | Rely on runtime behavior |
| TS projects | Enjoy full type safety |
This project is licensed under the MIT License. See the LICENSE file for details.
FAQs
Detects low-quality, fake, or placeholder user inputs beyond regex validation
The npm package input-sense receives a total of 143 weekly downloads. As such, input-sense popularity was classified as not popular.
We found that input-sense demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.