The `case` package (npm: `case`, version 1.6.3) provides an extensible utility for converting, identifying, and flipping string cases. It supports various common formats like camelCase, PascalCase, snake_case, kebab-case, and CONSTANT_CASE, as well as UI-focused cases like Title Case and Sentence case. A key differentiator is its extensibility, allowing users to define custom case types. Additionally, its `sentence` function offers specialized handling for proper names and abbreviations. This package was last updated over six years ago, with version 1.6.3 published six years ago, indicating it is no longer actively maintained. Its release cadence was sporadic, with significant gaps between updates in its later history. It ships with TypeScript types, supporting usage in modern TypeScript projects, but its primary target environment was Node.js >= 0.8.0 and browsers via UMD, reflecting an older development era.
npm install caseVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates common string case conversions, UI helpers, and the case identification utility, showcasing the library's core functionality with modern ESM imports.
Replace `Case.squish(str)` with `Case.pascal(str)`.
Use `import Case from 'case';` for ESM or `const Case = require('case');` for CommonJS.Consider migrating to a actively maintained string utility library that provides similar functionality and receives regular updates. If continued use is necessary, thoroughly audit the codebase for security concerns.
For CommonJS projects, use `const Case = require('case');`. For ESM projects, `import Case from 'case';` should work, but be mindful of potential tooling configuration for older modules. Test thoroughly in your target environment.Ensure you are using `import Case from 'case';` in ESM or `const Case = require('case');` in CommonJS. The library exports its API as properties of a single default object, not as individual named exports.Add `import Case from 'case';` at the top of your ESM file or `const Case = require('case');` in your CommonJS file. Ensure it's in the correct scope for where you intend to use it.Verify your project's module type. If `case` is mistakenly treated as ESM by a bundler, adjust the bundler configuration. For newer projects, try using `import Case from 'case';` instead of `require('case')` in an ESM context.No dependency data recorded yet.