Multiline is a small JavaScript utility created to make multiline strings easier to write before template literals became standard. It extracts the contents of a block comment placed inside an anonymous function and returns that text as a string. This avoids long chains of concatenated strings or arrays joined with newline characters. A stripIndent helper removes redundant leading indentation while preserving the intended layout. The package can be used for CLI help text, welcome messages, test fixtures, and multiline queries. It primarily targets Node.js, although it can also work in browsers with a bundler. The repository is archived and deprecated, and its own documentation recommends ES2015 template literals for modern code.
Features
- Block-comment based multiline strings
- Automatic newline preservation
- Optional indentation stripping
- Node.js-focused usage
- Browser support through bundlers
- Useful for help text, fixtures, messages, and queries