Word-wrap is a lightweight npm package designed for text manipulation, specifically wrapping long lines of text to fit within a specified column width. Version 0.1.2, released on April 23, 2014, builds upon the earlier 0.1.0 version from March 30, 2014, by introducing a key dependency: the "longest" package, version ~0.2.1. This addition likely enhances the word-wrapping logic by providing functionality to determine the longest word in a given string, allowing for more accurate and visually appealing wrapping, especially when dealing with text containing exceptionally long words or identifiers.
A minor difference lies in the "verb" devDependency. Version 0.1.2 uses verb version ~0.2.2, while the 0.1.0 uses verb version ~0.1.20 which suggests improvements or updates in the documentation generation or project scaffolding aspects of the development workflow, rather than impacting the core word-wrapping functionality.
Developers considering the word-wrap package should choose version 0.1.2 for its potentially improved word-wrapping accuracy thanks to the "longest" dependency. Both versions maintain the same core functionality of wrapping words and are authored by Jon Schlinkert. The package is available through npm and the source code resides on GitHub. The "longest" dependency might result in a slightly larger bundle size but the improvement in text formatting is worth it.
All the vulnerabilities related to the version 0.1.2 of the package
word-wrap vulnerable to Regular Expression Denial of Service
All versions of the package word-wrap are vulnerable to Regular Expression Denial of Service (ReDoS) due to the usage of an insecure regular expression within the result variable.