1.0.0 • Published 6 years ago
truncate-words v1.0.0
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.
1.0.0
6 years ago