{"id":16252374,"url":"https://github.com/remarkablemark/splace","last_synced_at":"2025-03-19T20:31:17.883Z","repository":{"id":65553195,"uuid":"581409605","full_name":"remarkablemark/splace","owner":"remarkablemark","description":"✂️ Split and replace string","archived":false,"fork":false,"pushed_at":"2024-10-29T20:36:20.000Z","size":1542,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-29T22:49:43.848Z","etag":null,"topics":["javascript","npm","replace","split","string","typescript"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/splace","language":"TypeScript","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/remarkablemark.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["remarkablemark"],"patreon":"remarkablemark","open_collective":null,"ko_fi":"remarkablemark","tidelift":null,"community_bridge":null,"liberapay":"remarkablemark","issuehunt":null,"otechie":null,"custom":["https://b.remarkabl.org/teespring"]}},"created_at":"2022-12-23T05:20:28.000Z","updated_at":"2024-10-29T20:36:23.000Z","dependencies_parsed_at":"2023-12-25T21:36:50.968Z","dependency_job_id":"238b03b0-7ae3-497c-9f07-c2c6309c7d3a","html_url":"https://github.com/remarkablemark/splace","commit_stats":{"total_commits":383,"total_committers":5,"mean_commits":76.6,"dds":"0.057441253263707526","last_synced_commit":"6484b7ac95aac0fdc911b5dbf3de50afdb995e7f"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkablemark%2Fsplace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkablemark%2Fsplace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkablemark%2Fsplace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkablemark%2Fsplace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remarkablemark","download_url":"https://codeload.github.com/remarkablemark/splace/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244018854,"owners_count":20384647,"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":["javascript","npm","replace","split","string","typescript"],"created_at":"2024-10-10T15:13:26.739Z","updated_at":"2025-03-19T20:31:17.375Z","avatar_url":"https://github.com/remarkablemark.png","language":"TypeScript","funding_links":["https://github.com/sponsors/remarkablemark","https://patreon.com/remarkablemark","https://ko-fi.com/remarkablemark","https://liberapay.com/remarkablemark","https://b.remarkabl.org/teespring"],"categories":[],"sub_categories":[],"readme":"# splace\n\n[![NPM](https://nodei.co/npm/splace.png)](https://nodei.co/npm/splace/)\n\n[![NPM version](https://img.shields.io/npm/v/splace.svg)](https://www.npmjs.com/package/splace)\n[![build](https://github.com/remarkablemark/splace/actions/workflows/build.yml/badge.svg)](https://github.com/remarkablemark/splace/actions/workflows/build.yml)\n[![codecov](https://codecov.io/gh/remarkablemark/splace/branch/master/graph/badge.svg?token=3G1H3T9BPT)](https://codecov.io/gh/remarkablemark/splace)\n\nSplit and replace string:\n\n```\nsplace(string, replace[, excludeEmpty])\n```\n\n[Replit](https://replit.com/@remarkablemark/splace)\n\n## Quick Start\n\n```ts\nimport { splace } from 'splace';\n\nsplace('Hello, world!', { world: 'person' }); // ['Hello, ', 'person', '!']\n```\n\n## Installation\n\n[NPM](https://www.npmjs.com/package/splace):\n\n```sh\nnpm install splace\n```\n\n[Yarn](https://yarnpkg.com/package/splace):\n\n```sh\nyarn add splace\n```\n\n## Usage\n\nImport with ES modules:\n\n```ts\nimport { splace } from 'splace';\n```\n\nRequire with CommonJS:\n\n```ts\nconst { splace } = require('splace');\n```\n\nSplit and replace a word:\n\n```ts\nsplace('Hello, world!', { world: 'mate' });\n// ['Hello, ', 'mate', '!']\n```\n\nSplit and replace words:\n\n```ts\nsplace('Hello, world!', { Hello: \"G'day\", world: 'mate' });\n// [\"G'day\", ', ', 'mate', '!']\n```\n\nSplit and replace based on object order:\n\n```ts\nsplace('How much wood would a woodchuck chuck, if a woodchuck could chuck wood?', {\n  woodchuck: 'foo',\n  wood: 'bar',\n  chuck: 'baz',\n}).join('');\n// 'How much bar would a foo baz, if a foo could baz bar?'\n```\n\nSplit and replace string with non-string values:\n\n```ts\nsplace('1 + 1 = 2', { 1: {}, 2: [] });\n// [{}, ' + ', {}, ' = ', []]\n```\n\nEmpty strings are removed by default. To keep empty strings:\n\n```ts\nsplace('foo', { foo: 'bar' }, false);\n// ['', 'bar', '']\n```\n\n## Release\n\nRelease is automated with [Release Please](https://github.com/googleapis/release-please).\n\n## License\n\n[MIT](https://github.com/remarkablemark/splace/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremarkablemark%2Fsplace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremarkablemark%2Fsplace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremarkablemark%2Fsplace/lists"}