{"_id":"heredoc","_rev":"1416456","name":"heredoc","description":"multiline strings for javascript","dist-tags":{"latest":"1.3.1"},"maintainers":[{"name":"jden","email":"jason@denizac.org"}],"time":{"modified":"2026-09-14T03:31:58.000Z","created":"2012-12-29T21:26:11.533Z","1.3.1":"2015-06-10T03:28:34.129Z","1.3.0":"2015-01-13T19:01:16.327Z","1.2.0":"2013-07-29T19:32:02.512Z","1.1.0":"2013-03-10T03:42:36.289Z","1.0.0":"2012-12-29T21:26:11.533Z"},"users":{"quafoo":true},"author":{"name":"jden","email":"jason@denizac.org"},"repository":{"type":"git","url":"git://github.com/jden/heredoc.git"},"versions":{"1.3.1":{"name":"heredoc","version":"1.3.1","description":"multiline strings for javascript","main":"index.js","scripts":{"test":"standard && mocha","test-browser":"echo open http://localhost:5000/test/runner.html && oceanify serve"},"repository":{"type":"git","url":"git://github.com/jden/heredoc.git"},"keywords":["multiline","string","heredoc","literal"],"author":{"name":"jden","email":"jason@denizac.org"},"contributors":[{"name":"jden","email":"jason@denizac.org"},{"name":"Jake Chen","email":"jakeplus@gmail.com"}],"license":"ISC","devDependencies":{"mocha":"~2.2.5","oceanifier":"~3.0.1","opener":"^1.4.1","should":"~6.0.3","standard":"^4.0.1"},"gitHead":"f6fc5340c4362167ded8aea51c9525153006ec82","bugs":{"url":"https://github.com/jden/heredoc/issues"},"homepage":"https://github.com/jden/heredoc","_id":"heredoc@1.3.1","_shasum":"2b0de9b80aca3fd0c6937b0e8f9efd6150e0dbd7","_from":".","_npmVersion":"2.7.0","_nodeVersion":"0.10.36","_npmUser":{"name":"jden","email":"jason@denizac.org"},"dist":{"shasum":"2b0de9b80aca3fd0c6937b0e8f9efd6150e0dbd7","tarball":"http://registry-npm.ywwl.com/heredoc/download/heredoc-1.3.1.tgz","integrity":"sha512-VL/rh/EXkhgpIWSNNde3OPc067oQiorfY+Nhkwgo2jAAIgrLLb5N92wmOblTyMWwCcIKo+8aQzk5s5YxLbVJPQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDJdhlX3hP5zw1p4DcTW6PdTzKxGFBZjwu2B+MOi2/XeAiEA7up1TynXzjyIituQITuC9YelW/0pwBXJRNIiqEqiY7g="}],"size":2777,"noattachment":false,"key":"/heredoc/-/heredoc-1.3.1.tgz"},"maintainers":[{"name":"jden","email":"jason@denizac.org"}],"directories":{},"publish_time":1433906914129,"_cnpm_publish_time":1433906914129},"1.3.0":{"name":"heredoc","version":"1.3.0","description":"multiline strings for javascript","main":"index.js","scripts":{"test":"node node_modules/mocha/bin/mocha"},"repository":{"type":"git","url":"git://github.com/jden/heredoc.git"},"keywords":["multiline","string","heredoc","literal"],"author":{"name":"jden","email":"jason@denizac.org"},"contributors":[{"name":"jden","email":"jason@denizac.org"},{"name":"Jake Chen","email":"jakeplus@gmail.com"}],"license":"AS IS","devDependencies":{"mocha":"~1.12.0","chai":"~1.7.2"},"bugs":{"url":"https://github.com/jden/heredoc/issues"},"homepage":"https://github.com/jden/heredoc","_id":"heredoc@1.3.0","dist":{"shasum":"9923b55db6a56ce970ec301c246a224e710a4f3d","tarball":"http://registry-npm.ywwl.com/heredoc/download/heredoc-1.3.0.tgz","integrity":"sha512-Nme6QA8H4hClTYFs6bAF5/IS9CKSXs1V/oGyZlBcHgS+6tPfQ2EFA1rnkdSf4pI7IPYuC7agyxGrzK5zfa6B2Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDR07Vru3kdGGH4Qt78mkwdyaWdmLzZkGxyXrJXmDIgjQIhAK43A5shXk42W1WPKnV+MoSVcfsoE41QOOqPtg3NXrjw"}],"size":1980,"noattachment":false,"key":"/heredoc/-/heredoc-1.3.0.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"jden","email":"jason@denizac.org"},"maintainers":[{"name":"jden","email":"jason@denizac.org"}],"directories":{},"publish_time":1421175676327,"_cnpm_publish_time":1421175676327},"1.2.0":{"name":"heredoc","version":"1.2.0","description":"multiline strings for javascript","main":"index.js","scripts":{"test":"node node_modules/mocha/bin/mocha"},"repository":{"type":"git","url":"git://github.com/jden/heredoc.git"},"keywords":["multiline","string","heredoc","literal"],"author":{"name":"jden","email":"jason@denizac.org"},"contributors":[{"name":"jden","email":"jason@denizac.org"},{"name":"Jason Kuhrt","email":"jasonkuhrt@me.com"},{"name":"Guy Bedford","email":"guybedford@gmail.com"},{"name":"Jake Chen","email":"jakeplus@gmail.com"}],"license":"AS IS","devDependencies":{"mocha":"~1.12.0","chai":"~1.7.2"},"bugs":{"url":"https://github.com/jden/heredoc/issues"},"_id":"heredoc@1.2.0","dist":{"shasum":"0f5f44c8f844e738ff3b9eacd7c3384d5bfad63c","tarball":"http://registry-npm.ywwl.com/heredoc/download/heredoc-1.2.0.tgz","integrity":"sha512-77qFjkoe2JYhyvzXc9T1GIGX6REu3hUWP7j1Kse2xa+wl57p+I3vrnE3WEsycooulgoTkPmMh3P/LXVU0aQRxQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7B265RgZbvDivrLdxERSTy2SOjO9it0e7gganp19OPwIhAONP9r+XzQHzzKeVHjvAlycAbE+GYWZoxPlQHIzy6OtL"}],"size":1938,"noattachment":false,"key":"/heredoc/-/heredoc-1.2.0.tgz"},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"jden","email":"jason@denizac.org"},"maintainers":[{"name":"jden","email":"jason@denizac.org"}],"directories":{},"publish_time":1375126322512,"_cnpm_publish_time":1375126322512},"1.1.0":{"name":"heredoc","version":"1.1.0","description":"multiline strings for javascript","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/jden/heredoc.git"},"keywords":["multiline","string","heredoc","literal"],"author":{"name":"jden","email":"jason@denizac.org"},"license":"AS IS","_id":"heredoc@1.1.0","dist":{"shasum":"b42bb8dea9949cadae06ced81e385680f505e52f","tarball":"http://registry-npm.ywwl.com/heredoc/download/heredoc-1.1.0.tgz","integrity":"sha512-HHzqSCYJC3UBjZmZbW9qFlsAECGFt1lVk5+e8aaKC9kK9IPHrMEPKMp3OML99lxLk/VfitqFH+Yw8e8rrd+JHA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBMSdc+ckHFARItmr7OWdX+6x8+hjtW/x3olSfGOWi6AIgYIKcuIIraxKSiScCHBp3uoUID+r68gUTQK8zEKE6c6Y="}],"size":1025,"noattachment":false,"key":"/heredoc/-/heredoc-1.1.0.tgz"},"_from":".","_npmVersion":"1.2.12","_npmUser":{"name":"jden","email":"jason@denizac.org"},"maintainers":[{"name":"jden","email":"jason@denizac.org"}],"directories":{},"publish_time":1362886956289,"_cnpm_publish_time":1362886956289},"1.0.0":{"name":"heredoc","version":"1.0.0","description":"multiline strings for javascript","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/jden/heredoc.git"},"keywords":["multiline","string","heredoc","literal"],"author":{"name":"jden","email":"jason@denizac.org"},"license":"AS IS","_id":"heredoc@1.0.0","dist":{"shasum":"4fceada9bffdd28565b0cffea83f4e48bc1038e1","tarball":"http://registry-npm.ywwl.com/heredoc/download/heredoc-1.0.0.tgz","integrity":"sha512-9AE30X4l4ws0y3KPRFesvVGns/4M82Ik4SYoXXslbJ7kSCF/F6kfkckETb9lSZGzEcF08ZgBsI1aaZDhvIFgHA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjk9qjUHxtt+Osm7NB2M8xu3S61CBeAhQ42FZ6CEyyiwIhAJBAfTjqp88/FWgdEY7HBO7eiR6GD7QFLRm53W70dXDq"}],"size":881,"noattachment":false,"key":"/heredoc/-/heredoc-1.0.0.tgz"},"_npmVersion":"1.1.70","_npmUser":{"name":"jden","email":"jason@denizac.org"},"maintainers":[{"name":"jden","email":"jason@denizac.org"}],"directories":{},"publish_time":1356816371533,"_cnpm_publish_time":1356816371533}},"readme":"# heredoc\nmultiline strings for javascript\n\n[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) [![Circle CI](https://circleci.com/gh/jden/heredoc.svg?style=svg)](https://circleci.com/gh/jden/heredoc) \n\n\n## usage\n\nthis technique takes advantage of `Function.prototype.toString()`\n\n```js\n    var heredoc = require('heredoc')\n    var str = heredoc(function () {/*\n    within this comment block,\n    any text\n    will\n      be\n        treated\n          as\n      pre-formatted\n        multiline text\n    (kinda like html <pre>)\n    */})\n    console.log(str)\n```\n\nYou can also strip leading indentation:\n\n```js\nvar text = heredoc.strip(function() {/*\n      <body>\n        <p>indented strings are fine.</p>\n        <p>the preceding spaces will be shrinked.</p>\n      </body>\n    */})\n```\n\nwill result in:\n\n```\n<body>\n  <p>indented strings are fine.</p>\n  <p>the preceding spaces will be shrinked.</p>\n</body>\n\n```\n\n## AMD\n\n`heredoc` defines itself as an AMD module for use in AMD environments.\n\n## installation\n\n    $ npm install heredoc\n\n## testing\n\nInstall all dependencies:\n\n```bash\n$ npm install\n$ npm test        # run tests in node\n$ npm run test-browser       # start a server to run tests in browser\n$ open http://localhost:5000/test/runner.html\n```\n\n## contributors\n\n  - jden <jason@denizac.org>\n  - Jason Kuhrt <jasonkuhrt@me.com>\n  - Guy Bedford <guybedford@gmail.com>\n  - Jake Chen <jakeplus@gmail.com>\n\n## kudos\n\nthanks to @izs - I first saw this technique when reading through npm source. I find it to be much neater than lots of manual string concatenation.\n\n## license\nISC\n","_attachments":{},"homepage":"https://github.com/jden/heredoc","bugs":{"url":"https://github.com/jden/heredoc/issues"},"license":"ISC"}