# fleck

> a functional-style string inflection library

Latest version **0.5.1** (published 2011-10-19) · 0 weekly downloads

## Install

```sh
npm install fleck
pnpm add fleck
yarn add fleck
bun add fleck
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.1 |
| Published | 2011-10-19 |
| First published | 2011-10-19 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 59 |
| Author | Trek Glowacki |
| Maintainers | trek |
| Keywords | fleck, ender, sting, inflection, pluralize |

## Links

- npm: https://www.npmjs.com/package/fleck
- Repository: https://github.com/trek/fleck
- Homepage: http://github.com/trek/fleck
- npm.io page: https://npm.io/package/fleck

## Alternatives

- [@snazzah/davey](https://npm.io/package/@snazzah/davey.md) — 1.5M weekly downloads
- [@vendure/testing](https://npm.io/package/@vendure/testing.md) — 8.3K weekly downloads
- [vue-simple-context-menu](https://npm.io/package/vue-simple-context-menu.md) — 6.6K weekly downloads
- [cypress-webpack-preprocessor-v5](https://npm.io/package/cypress-webpack-preprocessor-v5.md) — 2.1K weekly downloads
- [@backstage/plugin-catalog-backend-module-puppetdb](https://npm.io/package/@backstage/plugin-catalog-backend-module-puppetdb.md) — 1.3K weekly downloads

## Recent versions

- 0.5.1 (latest) — 2011-10-19
- 0.5.0 — 2011-10-19

## README

`fleck` is a functional styled library for string inflection that doesn't pollute `String.prototype`.

Basic Use
====================
All the inflections are stored inside `fleck`.  They are:

```javascript
// Capitals
fleck.capitalize('acme') == 'Acme'

// CamelCase and camelCase
fleck.camelize('border-radius') == 'borderRadius'
fleck.camelize('border-radius', true) == 'BorderRadius' // alias for upperCamelize
fleck.upperCamelize('we-the-people') == 'WeThePeople'

// Changes underscores and spaces into dashes
fleck.dasherize('we_the_people') == 'we-the-people'

// Underscore
// Converts camelCase, CamelCase, dash-es, and Name::Spaced to underscores
fleck.underscore("camelCase") == 'camel_case'
fleck.underscore("CamelCase") == 'camel_case'
fleck.underscore("dash-es")   == 'dash_es'
fleck.underscore("Name::Spaced") == 'name_spaced'

// Plurals and Singular, even strange ones
fleck.pluralize('dog') == 'dogs'
fleck.pluralize('person') == 'people'
fleck.pluralize('sheep') == 'sheep'
fleck.singularize('dogs') == 'dog'
fleck.singularize('people') == 'person'

// Whitespace stripping
fleck.strip('    hello!   ') == 'hello!'

// Ordinals
fleck.ordinalize(4) == "4th"
fleck.ordinalize("13") == "13th"
fleck.ordinalize("122") == "122nd"
```

Functional Programing
======
`fleck` doesn't contain any unpredictable javascript object orientation. Feel free to combine
with other functional libraries at will; no new anonymous functions, no silly `bind`s:

```javascript
// underscore.js
_.each(['dog','cat','mouse'], fleck.pluralize) == ["dogs", "cats", "mice"]

// jQuery.js
$.ajax({
  url:'/data/sync_from_server/new/uncountablewords',
  success: fleck.uncountable
})
```

Chaining
======
Inflections can be chained using `fleck.inflect`

```javascript
fleck.inflect('     posts', 'strip', 'singularize', 'capitalize') == 'Post'
```

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