npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

case-study

v1.1.1

Published

Find, count or verify uppercase and lowercase words in a string

Readme

case-study build npm downloads

Extract, count, or check uppercase and lowercase words in any string.

Install

$ npm install case-study

Usage

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"]

APIs

findUpperCase(str, options)

Returns: Array<String> of uppercase words

findLowerCase(str, options)

Returns: Array<String> of lowercase words

upperCaseExists(str, options)

Returns: Boolean

lowerCaseExists(str, options)

Returns: Boolean

countUpperCase(str, options)

Returns: Number

countLowerCase(str, options)

Returns: Number


Options

Type: Object

contraction

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" ]

duplicate

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"]

list

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"]

exclude

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"]

Related

License

MIT © Talha Awan