xiCO2k / nl2br

A NodeJS module for converting newlines (\n) to line breaks (<br>)

Home Page:https://www.npmjs.org/package/nl2br

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nl2br

nl2br - A NodeJS module for converting newlines to line breaks

Based on this answer in StackOverflow

##Install

$ npm install nl2br

Example

var nl2br  = require('nl2br');

// Non-XHTML Way
nl2br('Base\nballs');  // returns 'Base<br>balls'

// XHTML Way
nl2br('Base\nballs', true);  // returns 'Base<br />balls'

About

A NodeJS module for converting newlines (\n) to line breaks (<br>)

https://www.npmjs.org/package/nl2br

License:MIT License


Languages

Language:JavaScript 100.0%