🚀 Launch Week Day 4:Introducing the Alert Details Page: A Better Way to Explore Alerts.Learn More →
Socket
Book a DemoInstallSign in
Socket

newline-to-br

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

newline-to-br

Format newlines to tags

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

newline-to-br

NPM version build status Test coverage Downloads

Format newlines to <br> tags. Supports linux, osx and windows newlines.

Installation

npm install newline-to-br

Usage

var toBr = require('newline-to-br');

toBr('This page cannot be displayed because \n your computer is currently offline');

// => 'This page cannot be displayed because <br> computer is currently offline'
br {
   display: block;
   margin: 0;
   padding: 0;
   border: none;
   content: " ";
}

@media only screen and (max-width: 475px) {
   br { display: none; }
}

Why?

Because by changing our newlines to <br> tags we can add custom styling which gives us finer-grained control over our text.

See also

License

MIT

Keywords

newlines

FAQs

Package last updated on 19 Oct 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts