{"id":21186610,"url":"https://github.com/fetchte/stringmerge","last_synced_at":"2025-10-29T21:17:22.861Z","repository":{"id":57372696,"uuid":"105946527","full_name":"fetchTe/stringmerge","owner":"fetchTe","description":"String Alternating Merge","archived":false,"fork":false,"pushed_at":"2017-10-06T20:34:01.000Z","size":1182,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-21T12:48:39.206Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fetchTe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-05T22:26:10.000Z","updated_at":"2023-03-08T03:41:25.000Z","dependencies_parsed_at":"2022-09-16T11:52:50.828Z","dependency_job_id":null,"html_url":"https://github.com/fetchTe/stringmerge","commit_stats":null,"previous_names":["fetchte/stringmerge"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fetchTe%2Fstringmerge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fetchTe%2Fstringmerge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fetchTe%2Fstringmerge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fetchTe%2Fstringmerge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fetchTe","download_url":"https://codeload.github.com/fetchTe/stringmerge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243639557,"owners_count":20323511,"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-11-20T18:24:40.406Z","updated_at":"2025-10-29T21:17:17.838Z","avatar_url":"https://github.com/fetchTe.png","language":"JavaScript","readme":"# stringmerge → String Alternating Merge\n[![npm](https://img.shields.io/npm/l/stringmerge.svg)](https://github.com/artisin/stringmerge/blob/master/LICENSE.txt)\n[![npm](https://img.shields.io/npm/v/stringmerge.svg)](https://www.npmjs.com/package/stringmerge)\n[![wercker status](https://app.wercker.com/status/a668f191696fe6b304f81c996a083c8c/s/master \"wercker status\")](https://app.wercker.com/project/byKey/a668f191696fe6b304f81c996a083c8c)\n[![David](https://img.shields.io/david/artisin/stringmerge.svg)](https://github.com/artisin/stringmerge/blob/master/package.json)\n\n\n## Description\n\nMerges multiple strings together alternating through their arguments.\n\n```\nmerge :: (...String) → String\nmerge :: ('abc', '123456') -\u003e 'a1b2c3456'\n```\n\n\n## Install\n\nYou can either install stringmerge via npm:\n\n```bash\n   yarn add stringmerge \n```\n\nAlternatively, you can download/copy one of files in the `/dist` folder depending on your use-case:\n\n+ `dist/stringmerge.js` - The node build for use with webpack and the like\n+ `dist/stringmerge-browser.js` - The browser build includes all the various library dependancies\n+ `dist/stringmerge-browser.min.js` - The minified version of browser version\n\n\n## Mode of Operation\n\nThe default export `merge` merges string arguments together via a simple `while` loop. Any non-string arguments will be disregarded.\n\n```js\nimport merge from 'stringmerge'\n\nconst mergedString = merge('abc', '123', 123, 'z');\n// should(mergeResults).be.eql('a1zb2c3');\n```\n\nAlternatively, you can use the `mergeGenerator` export which utilizes a [generator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators) to iterate through the arguments. This only makes sense if you have a ridiculous amount of arguments around the ballpark of +25000.\n\n```js\nimport { mergeGenerator } from 'stringmerge'\n\nconst mergedString = mergeGenerator('abc', '123', 123, 'z');\n// should(mergeResults).be.eql('a1zb2c3');\n```\n\n\n## Npm Sripts\n\n```yaml\nscripts:\n  build: 'Builds stringmerge → output dist/'\n  clean: 'deletes all dist/ files'\n  commit: 'commitizen commit'\n  dev: 'webpack watch development'\n  benchmark: 'runs benchmarks located in __tests__/benchmark.run.js'\n  test: 'runs test located in __tests__/tests.run.js'\n```\n\n\n## Benchmarks\n\n```\nmerge - two arguments          x 325,472 ops/sec ±1.10% (91 runs sampled)\nmergeGenerator - two arguments x 247,051 ops/sec ±0.50% (90 runs sampled)\n```\n\n```\nmerge - ten arguments          x 37,848 ops/sec ±0.55% (91 runs sampled)\nmergeGenerator - ten arguments x 25,903 ops/sec ±1.96% (89 runs sampled)\n```\n\n```\nmerge 50000 - arguments          x 0.13 ops/sec ±65.16% (5 runs sampled)\nmergeGenerator - 50000 arguments x 0.56 ops/sec ±50.97% (6 runs sampled)\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffetchte%2Fstringmerge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffetchte%2Fstringmerge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffetchte%2Fstringmerge/lists"}