# common-prefix

> Retrieve the common prefix across multiple strings

Latest version **1.1.0** (published 2016-03-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install common-prefix
pnpm add common-prefix
yarn add common-prefix
bun add common-prefix
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2016-03-09 |
| First published | 2014-09-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/common-prefix) |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Hugh Kennedy |
| Maintainers | hughsk |
| Keywords | common, prefix, string, start, first, same |

## Links

- npm: https://www.npmjs.com/package/common-prefix
- Repository: https://github.com/hughsk/common-prefix
- Issues: https://github.com/hughsk/common-prefix/issues
- npm.io page: https://npm.io/package/common-prefix

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 1.1.0 (latest) — 2016-03-09
- 1.0.0 — 2014-09-18

## README

# common-prefix [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

Retrieve the common prefix across multiple strings.

## Usage

[![NPM](https://nodei.co/npm/common-prefix.png)](https://nodei.co/npm/common-prefix/)

### `str = common(strings)`

For example:

``` javascript
var common = require('common-prefix')

common([
    'hello world'
  , 'hello again'
  , 'hello once again'
]) === 'hello '
```

## License

MIT. See [LICENSE.md](http://github.com/hughsk/common-prefix/blob/master/LICENSE.md) for details.

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