[Tools] Javascript Multi-line String Builder (and other things too!)

[Tools] Javascript Multi-line String Builder (and other things too!)

One thing that I find myself doing often as a server dev is taking SQL queries and turning them into strings for use in a server side script. In PHP or any other language that supports multi-line strings out of the box you can simply add a " at the top and bottom of your long multi-line sting. However Javascript, and as a consequence Node.JS, does not make this quite as simple.

There are many tricks for making multi-line strings in Javascript but I've always chosen to go with the add a + " at the start and a " at the end. Well now that has become a whole lot simpler.

Introducing Multi-liner!

You can start using it now at by clicking here

Reasons for making it.

  • I have not found any similar tool out there.
  • Even though it just takes a minute to wrap a query manually there always seems to be one mistake somewhere.
  • Something that takes minutes to do but is trivial is something more suited for a computer instead of letting it waste your precious development time. (oh geez, I better redact that or else I might have to start doing work)

If you'd like to get a copy of the (very small) source code you can pull it at github!