$ npm install oneliner
Converts a string that contains line feed characters into one that doesn't.
npm install oneliner
var oneliner = require('oneliner');
var template = " <html>\n\n<head></head>\n<body>...</body>\n</html>\n\n ";
oneliner(template);
The output should be:
"<html><head></head><body>...</body></html>"
To skip the whitespace trimming you may pass 'true' as the optional second argument:
oneliner(template, true);
And the output should be:
" <html><head></head><body>...</body></html> ";
© 2010 - cnpmjs.org x YWFE | Home | YWFE