# @zerodep/case-sentence

> A utility that deburrs a string, converts it to sentence case, strips all non-alphanumeric characters and removes leading numbers.

Latest version **2.0.15** (published 2024-10-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @zerodep/case-sentence
pnpm add @zerodep/case-sentence
yarn add @zerodep/case-sentence
bun add @zerodep/case-sentence
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.15 |
| Published | 2024-10-27 |
| First published | 2023-06-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Chris dePage |
| Maintainers | cdepage |
| Keywords | case, sentence, convert |

## Links

- npm: https://www.npmjs.com/package/@zerodep/case-sentence
- Repository: https://github.com/cdepage/zerodep
- Homepage: https://zerodep.app
- Issues: https://github.com/cdepage/zerodep/issues
- npm.io page: https://npm.io/package/@zerodep/case-sentence

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 2.0.15 (latest) — 2024-10-27
- 2.0.14 — 2024-07-23
- 2.0.13 — 2024-07-20
- 2.0.12 — 2024-07-20
- 2.0.9 — 2024-03-10
- 2.0.8 — 2024-03-10
- 2.0.7 — 2024-03-10
- 2.0.6 — 2023-10-15
- 2.0.5 — 2023-10-14
- 2.0.3 — 2023-06-30
- 2.0.2 — 2023-06-30
- 2.0.1 — 2023-06-30

## README

# @zerodep/case-sentence

[![version](https://img.shields.io/npm/v/@zerodep/case-sentence?style=flat-square&color=blue)](https://www.npmjs.com/package/@zerodep/case-sentence)
![language](https://img.shields.io/badge/typescript-100%25-blue?style=flat-square)
![types](https://img.shields.io/badge/types-included-blue?style=flat-square)
![license](https://img.shields.io/github/license/cdepage/zerodep?color=blue&style=flat-square)

[![CodeFactor](https://www.codefactor.io/repository/github/cdepage/zerodep/badge)](https://www.codefactor.io/repository/github/cdepage/zerodep)
[![Known Vulnerabilities](https://snyk.io/test/github/cdepage/zerodep/badge.svg)](https://snyk.io/test/github/cdepage/zerodep)

[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/9225/badge)](https://www.bestpractices.dev/projects/9225)

A utility that deburrs a string, converts it to sentence case, strips all non-alphanumeric characters and removes leading numbers.

This utility is intended for database field names, CSV header conversion, and other field normalizations, among other uses.

Full documentation is available at the [zerodep.app](http://zerodep.app/#/case/sentence) page.

## Signature

```typescript
declare const caseSentence: (value: string) => string;
```

## Examples

```javascript
// ESM
import { caseSentence } from '@zerodep/case-sentence';

// CJS
const { caseSentence } = require('@zerodep/case-sentence');
```

```javascript
caseSentence('from sentence case'); // "from sentence case"
caseSentence('from.dot.case'); // "from dot case"
caseSentence('fromCamelCase'); // "from camel case"
caseSentence('from_snake_case'); // "from snake case"
caseSentence('FromPascalCase'); // "from pascal case"
caseSentence(''); // ""

// with non-alphanumeric characters in the string
caseSentence('A string with some !@#$%^& characters'); // "a string with some characters"
caseSentence('A #22 character long string'); // "a 22 character long string"
caseSentence("I'm a sp3c!al $741ng"); // "i m a sp3c al 741ng"

// with accented characters
caseSentence('àëîóüý Žøñç'); // "aeiouy zonc"

// with leading special characters and numbers
caseSentence('__with    many --- spaces'); // "with many spaces"
caseCamel('12 monkeys see 6 bananas'); // "monkeys see 6 bananas"

// non-string values
caseSentence({ not: 'a string' }); // throws ZeroDepError: Value is not a string
```

---

## ZeroDep Advantages

- **Zero npm dependencies** - completely eliminates all risk of supply-chain attacks, decreases node_modules folder size
- **ESM & CJS** - supports both ECMAScript modules and common JavaScript exports
- **Tree Shakable** - built to be fully tree shakable ensuring your packages are the smallest possible size
- **Fully Typed** - typescript definitions are provided/built-in to every package for a superior developer experience
- **Semantically Named** - package and method names are easy to grok, remember, use, and read
- **Documented** - actually useful documentation with examples at [zerodep.app](https://zerodep.app)
- **Intelligently Packaged** - multiple npm packages of different sizes available allowing a menu or a-la-carte composition of capabilities
- **100% Tested** - all methods and packages are fully unit tested
- **Predictably Versioned** - semantically versioned for peace-of-mind upgrading, valuable changelogs for understand changes
- **MIT Licensed** - permissively licensed for maximum usability

---
_Source: https://npm.io/package/@zerodep/case-sentence · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
