{"id":13454573,"url":"https://github.com/sindresorhus/indent-string","last_synced_at":"2025-05-16T08:06:58.345Z","repository":{"id":402056,"uuid":"20576837","full_name":"sindresorhus/indent-string","owner":"sindresorhus","description":"Indent each line in a string","archived":false,"fork":false,"pushed_at":"2022-06-05T07:44:39.000Z","size":33,"stargazers_count":113,"open_issues_count":0,"forks_count":17,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-05-03T06:28:38.216Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sindresorhus.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/security.md","support":null},"funding":{"github":"sindresorhus","open_collective":"sindresorhus","custom":"https://sindresorhus.com/donate"}},"created_at":"2014-06-06T20:16:03.000Z","updated_at":"2025-02-19T11:07:46.000Z","dependencies_parsed_at":"2022-08-16T10:20:37.514Z","dependency_job_id":null,"html_url":"https://github.com/sindresorhus/indent-string","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Findent-string","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Findent-string/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Findent-string/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Findent-string/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/indent-string/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253661158,"owners_count":21943871,"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-07-31T08:00:55.512Z","updated_at":"2025-05-16T08:06:53.336Z","avatar_url":"https://github.com/sindresorhus.png","language":"JavaScript","readme":"# indent-string\n\n\u003e Indent each line in a string\n\n## Install\n\n```\n$ npm install indent-string\n```\n\n## Usage\n\n```js\nimport indentString from 'indent-string';\n\nindentString('Unicorns\\nRainbows', 4);\n//=\u003e '    Unicorns\\n    Rainbows'\n\nindentString('Unicorns\\nRainbows', 4, {indent: '♥'});\n//=\u003e '♥♥♥♥Unicorns\\n♥♥♥♥Rainbows'\n```\n\n## API\n\n### indentString(string, count?, options?)\n\n#### string\n\nType: `string`\n\nThe string to indent.\n\n#### count\n\nType: `number`\\\nDefault: `1`\n\nHow many times you want `options.indent` repeated.\n\n#### options\n\nType: `object`\n\n##### indent\n\nType: `string`\\\nDefault: `' '`\n\nThe string to use for the indent.\n\n##### includeEmptyLines\n\nType: `boolean`\\\nDefault: `false`\n\nAlso indent empty lines.\n\n## Related\n\n- [indent-string-cli](https://github.com/sindresorhus/indent-string-cli) - CLI for this module\n- [strip-indent](https://github.com/sindresorhus/strip-indent) - Strip leading whitespace from every line in a string\n- [redent](https://github.com/sindresorhus/redent) - Strip redundant indentation and indent the string\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\t\u003cb\u003e\n\t\t\u003ca href=\"https://tidelift.com/subscription/pkg/npm-indent-string?utm_source=npm-indent-string\u0026utm_medium=referral\u0026utm_campaign=readme\"\u003eGet professional support for this package with a Tidelift subscription\u003c/a\u003e\n\t\u003c/b\u003e\n\t\u003cbr\u003e\n\t\u003csub\u003e\n\t\tTidelift helps make open source sustainable for maintainers while giving companies\u003cbr\u003eassurances about security, maintenance, and licensing for their dependencies.\n\t\u003c/sub\u003e\n\u003c/div\u003e\n","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://sindresorhus.com/donate","https://tidelift.com/subscription/pkg/npm-indent-string?utm_source=npm-indent-string\u0026utm_medium=referral\u0026utm_campaign=readme"],"categories":["Packages","包","Repository","目录","JavaScript","Text","Helpful"],"sub_categories":["Text","文本","Text/String","文本处理"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Findent-string","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Findent-string","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Findent-string/lists"}