{"id":17802674,"url":"https://github.com/stefee/outerspace","last_synced_at":"2025-06-19T01:38:40.277Z","repository":{"id":48075059,"uuid":"111847711","full_name":"stefee/outerspace","owner":"stefee","description":null,"archived":false,"fork":false,"pushed_at":"2021-08-08T18:49:21.000Z","size":120,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"latest","last_synced_at":"2025-06-11T14:18:14.707Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stefee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-23T20:26:17.000Z","updated_at":"2022-01-23T15:56:23.000Z","dependencies_parsed_at":"2022-08-12T18:01:11.066Z","dependency_job_id":null,"html_url":"https://github.com/stefee/outerspace","commit_stats":null,"previous_names":["srilq/outerspace"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/stefee/outerspace","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefee%2Fouterspace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefee%2Fouterspace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefee%2Fouterspace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefee%2Fouterspace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stefee","download_url":"https://codeload.github.com/stefee/outerspace/tar.gz/refs/heads/latest","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefee%2Fouterspace/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260665099,"owners_count":23044265,"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","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-10-27T12:44:14.618Z","updated_at":"2025-06-19T01:38:35.262Z","avatar_url":"https://github.com/stefee.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# outerspace\n\n[![npm version](https://img.shields.io/npm/v/outerspace.svg?style=flat-square)](https://npmjs.org/package/outerspace) [![build status](https://img.shields.io/travis/stefee/outerspace/latest.svg?style=flat-square)](https://travis-ci.com/stefee/outerspace)\n[![downloads](https://img.shields.io/npm/dm/outerspace.svg?style=flat-square)](https://npmjs.org/package/outerspace) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)\n\n\u003e Preserve whitespace surrounding expressions in a template string.\n\nOuterspace helps to preserve outer whitespace when prefixing and suffixing\na string by moving any leading/trailing whitespace in the original string to the\nstart/end of the return.\n\n```js\nconst outerspace = require('outerspace')\n\nouterspace`**${'\\n Exclamation! \\n\\n'}**`\n// '\\n **Exclamation!** \\n\\n'\n\nouterspace`**${'\\n\\n Holy'} ${'Exclamation '}${'Batman! \\n'}**`\n// '\\n\\n **Holy Exclamation Batman!** \\n'\n\nouterspace.wrap('Holy ', '\\n\\n Exclamation \\n', ' Batman!')\n// '\\n\\n Holy Exclamation Batman! \\n'\n\nouterspace.before('\\n\\n Exclamation Batman! \\n', 'Holy ')\n// '\\n\\n Holy Exclamation Batman! \\n'\n\nouterspace.after('\\n\\n Holy Exclamation \\n', ' Batman!')\n// '\\n\\n Holy Exclamation Batman! \\n'\n```\n\n## API\n\n### ``outerspace`[before]${[exprs]}...[after]` ``\n\nTagged template function: move any leading whitespace in the first expression\nto the start of the return, and any trailing whitespace in the last expression\nto the end of the return.\n\n### `outerspace.wrap(before, string, after)`\n\nConcatenate the given strings in order and move leading/trailing whitespace in\n`string` to the start/end of the return.\n\n### `outerspace.before(string, before)`\n\nConcatenate the given strings in the order `before + string` and move leading\nwhitespace in `string` to the start of the return;\n\n### `outerspace.after(string, after)`\n\nConcatenate the given strings in the order `string + after` and move trailing\nwhitespace in `string` to the end of the return;\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefee%2Fouterspace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstefee%2Fouterspace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefee%2Fouterspace/lists"}