crop.js 302 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 var toString = require('../lang/toString'); var truncate = require('./truncate'); /** * Truncate string at full words. */ function crop(str, maxChars, append) { str = toString(str); return truncate(str, maxChars, append, true); } module.exports = crop;