Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/k4m4/lexis-count

Retrieve the number of words in a string.
https://github.com/k4m4/lexis-count

api count counter lexis nodejs words

Last synced: about 2 months ago
JSON representation

Retrieve the number of words in a string.

Awesome Lists containing this project

README

        

# lexis-count [![Build Status](https://travis-ci.org/k4m4/lexis-count.svg?branch=master)](https://travis-ci.org/k4m4/lexis-count)

> Retrieve the number of words in a string.

## Install

```
~ ❯❯❯ npm install lexis-count
```

## Usage

```js
const lexisCount = require('lexis-count');

lexisCount('Lorem ipsum dolor sit amet')
//=> 5

lexisCount(' Lorem ipsum dolor sit amet ')
//=> 5
```

## API

### lexisCount()

Type: `string`

Returns the number of words in a string.

## Related

- [lexis](https://github.com/k4m4/lexis) - CLI for this module

## Credits

- The regular expression used has been adapted from [word-regex](https://github.com/regexhq/word-regex) by [regexhq](https://github.com/regexhq).

## License

MIT © [Nikolaos Kamarinakis](https://nikolaskama.me)