words-only

Remove anything that isn't a word or letter from a string.

Usage no npm install needed!

<script type="module">
  import wordsOnly from 'https://cdn.skypack.dev/words-only';
</script>

README

words-only

Remove anything that isn't a word or letter from a string.

Build Status Coverage Status

Note: This is a work in progress. Testing and Pull Requests welcome.

Install

$ npm install --save words-only

Usage

const wordsOnly = require('words-only');

wordsOnly('unicorns!!!! & rainbows!!!!');
//=> 'unicorns rainbows'

API

wordsOnly(input)

input

Type: string

The string to search for words.

Notes

This module uses letterset to determine letters that belong to words. If you find that words-only is removing actual letters from your words, please open an issue on the letterset repo.

License

MIT © Michael Wuergler