Skip to content

Instantly share code, notes, and snippets.

@fentas
Created June 26, 2015 17:42
Show Gist options
  • Save fentas/fa79167a82bf15160421 to your computer and use it in GitHub Desktop.
Save fentas/fa79167a82bf15160421 to your computer and use it in GitHub Desktop.
Multi-line strings in JavaScript and Node.js
var html = (function () {/*
2 <!DOCTYPE html>
3 <html>
4 <body>
5 <h1>Hello, world!</h1>
6 </body>
7 </html>
8 */}).toString().match(/[^]*\/\*([^]*)\*\/\}$/)[1];
@perguth
Copy link

perguth commented Jun 30, 2015

let html =
`<html>
<h1>Yo Yoda!</h1>
</html>`

Then browserify script.js -t babelify --outfile bundle.js =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment