
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
case-study
Advanced tools
Extract, count, or check uppercase and lowercase words in any string.
$ npm install case-study
const caseStudy = require("case-study");
const wordsWithCase = `The documentation is important. PLEASE MAKE SURE YOU'VE READ THE DOCUMENTATION.`;
caseStudy.findUpperCase(wordsWithCase);
// => ["PLEASE","MAKE","SURE","YOU'VE","READ","THE","DOCUMENTATION"]
caseStudy.findLowerCase(wordsWithCase);
// => ["documentation","is","important"]
const wordsWithNumbers = `K2, H2O, B2B, B2C, AK47, 3G, G8, 7UP,
and gr8, 1to1, one2one, 8pm.`;
caseStudy.findUpperCase(wordsWithNumbers);
// => ["K2","H2O","B2B","B2C","AK47","3G","G8","7UP"]
caseStudy.findLowerCase(wordsWithNumbers);
// => ["and","gr8","1to1","one2one","8pm"]
Returns: Array<String> of uppercase words
Returns: Array<String> of lowercase words
Returns: Boolean
Returns: Boolean
Returns: Number
Returns: Number
Type: Object
Type: Boolean
Default: true
Treat contractions as a single word.
let str = `CONTRACTIONS ARE HANDLED TOO. SUCH AS SHOULDN'T'VE!`;
caseStudy.findUpperCase(str);
// => ["CONTRACTIONS","ARE","HANDLED","TOO","SUCH","AS","SHOULDN'T'VE"]
caseStudy.findUpperCase(str, { contraction: false });
// => ["CONTRACTIONS","ARE","HANDLED","TOO","SUCH","AS","SHOULDN","T","VE"]
str = `Similarly in lowercase. Examples: d'y'all and shouldn't've.`;
caseStudy.findLowerCase(str);
// => ["in","lowercase","d'y'all","and", "shouldn't've"]
caseStudy.findLowerCase(str, { contraction: false });
// => ["in","lowercase","d","y","all","and","shouldn","t","ve" ]
Type: Boolean
Default: true
Include duplicate words.
let str = `SO SO MANY WORDS!`;
caseStudy.findUpperCase(str, { duplicate: false });
// => ["SO","MANY","WORDS"]
str = `He had a one on one meeting.`;
caseStudy.findLowerCase(str, { duplicate: false });
// => ["had","a","one","on","meeting"]
Type: Array
Only extract words passed in the list
let str = "WARNING: THE SYSTEM WARNING HAS BEEN LOGGED SUCCESSFULLY.";
caseStudy.findUpperCase(str, { list: ["WARNING"] });
// => ["WARNING", "WARNING"]
let str = `The package was delivered, but the delivery confirmation is pending.`;
caseStudy.findLowerCase(str, { list: ["package", "delivery"] });
// => ["package", "delivery"]
Type: Array
Ignore words passed in the list
let str = "PLEASE FOLLOW THE SETUP INSTRUCTIONS IN THE MANUAL.";
caseStudy.findUpperCase(str, { exclude: ["PLEASE", "SETUP"] });
// => ["FOLLOW", "THE", "INSTRUCTIONS", "IN", "THE", "MANUAL"]
let str = `your changes saved successfully!`;
caseStudy.findLowerCase(str, { exclude: ["your"] });
// => ["changes", "saved", "successfully"]
MIT © Talha Awan
FAQs
Find, count or verify uppercase and lowercase words in a string
We found that case-study 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
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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.