{"id":18687283,"url":"https://github.com/junosuarez/heredoc","last_synced_at":"2025-12-17T07:51:37.800Z","repository":{"id":6141783,"uuid":"7370611","full_name":"junosuarez/heredoc","owner":"junosuarez","description":"npm module: multiline strings for javascript","archived":false,"fork":false,"pushed_at":"2015-10-21T08:16:04.000Z","size":176,"stargazers_count":53,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-12T23:27:46.047Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/junosuarez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-12-29T21:25:26.000Z","updated_at":"2024-08-15T14:50:23.000Z","dependencies_parsed_at":"2022-09-19T06:01:24.758Z","dependency_job_id":null,"html_url":"https://github.com/junosuarez/heredoc","commit_stats":null,"previous_names":["jden/heredoc"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/junosuarez/heredoc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junosuarez%2Fheredoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junosuarez%2Fheredoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junosuarez%2Fheredoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junosuarez%2Fheredoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/junosuarez","download_url":"https://codeload.github.com/junosuarez/heredoc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junosuarez%2Fheredoc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27779776,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-17T02:00:08.291Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T10:32:19.370Z","updated_at":"2025-12-17T07:51:37.784Z","avatar_url":"https://github.com/junosuarez.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"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 \u003cpre\u003e)\n    */})\n    console.log(str)\n```\n\nYou can also strip leading indentation:\n\n```js\nvar text = heredoc.strip(function() {/*\n      \u003cbody\u003e\n        \u003cp\u003eindented strings are fine.\u003c/p\u003e\n        \u003cp\u003ethe preceding spaces will be shrinked.\u003c/p\u003e\n      \u003c/body\u003e\n    */})\n```\n\nwill result in:\n\n```\n\u003cbody\u003e\n  \u003cp\u003eindented strings are fine.\u003c/p\u003e\n  \u003cp\u003ethe preceding spaces will be shrinked.\u003c/p\u003e\n\u003c/body\u003e\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 \u003cjason@denizac.org\u003e\n  - Jason Kuhrt \u003cjasonkuhrt@me.com\u003e\n  - Guy Bedford \u003cguybedford@gmail.com\u003e\n  - Jake Chen \u003cjakeplus@gmail.com\u003e\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunosuarez%2Fheredoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjunosuarez%2Fheredoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunosuarez%2Fheredoc/lists"}