Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

truncate-words

1.0.0 • Public • Published

truncate-words

Truncates a string after a certain number of words.

const truncateWords = require('truncate-words')
const a = 'The nuclear deal is based on lies.'
truncateWords(a, 4) // 'The nuclear deal is [...]'

This is similar to the truncatewords filter found in Django.

Keywords

none

Install

npm i truncate-words

DownloadsWeekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

108 kB

Total Files

6

Last publish

Collaborators

  • avatar