up-down-pad
v0.0.2
Published
Adds a given number of newline characters to *both* before and after a given string.
Downloads
20
Readme
up-down-pad
Adds a given number of newline characters to both before and after a given string.
Install
$ npm install up-down-pad
Usage
upDownPad = require('up-down-pad')
upDownPad('foo', 5)// => "\n\n\n\n\nfoo\n\n\n\n\n"
upDownPad('foobar', 6) // => "\n\n\n\n\n\nfoobar\n\n\n\n\n\n"
upDownPad(1, 2) // => "\n\n1\n\n"
upDownPad(20, -1) // => "20"