{"id":16667274,"url":"https://github.com/peterpme/sub-in","last_synced_at":"2025-06-28T16:40:46.589Z","repository":{"id":57373860,"uuid":"120255414","full_name":"peterpme/sub-in","owner":"peterpme","description":"🥙 A tiny (115B) find-and-replace utility for strings in Javascript","archived":false,"fork":false,"pushed_at":"2018-02-06T17:43:21.000Z","size":46,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-14T05:16:39.508Z","etag":null,"topics":["find-and-replace","regex","sub","tiny"],"latest_commit_sha":null,"homepage":"https://npm.im/sub-in","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/peterpme.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":"2018-02-05T04:37:37.000Z","updated_at":"2023-08-31T10:01:05.000Z","dependencies_parsed_at":"2022-09-26T16:50:43.372Z","dependency_job_id":null,"html_url":"https://github.com/peterpme/sub-in","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/peterpme/sub-in","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterpme%2Fsub-in","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterpme%2Fsub-in/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterpme%2Fsub-in/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterpme%2Fsub-in/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterpme","download_url":"https://codeload.github.com/peterpme/sub-in/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterpme%2Fsub-in/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262460936,"owners_count":23314851,"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":["find-and-replace","regex","sub","tiny"],"created_at":"2024-10-12T11:13:41.855Z","updated_at":"2025-06-28T16:40:46.525Z","avatar_url":"https://github.com/peterpme.png","language":"JavaScript","funding_links":[],"categories":["Framework agnostic packages"],"sub_categories":["General utilities"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://i.imgur.com/508SkFr.png\" width=\"500\" alt=\"SubIn\"\u003e\n\u003c/p\u003e\n\n## 🥙 SubIn [![npm](https://img.shields.io/npm/v/sub-in.svg)](https://npm.im/sub-in) [![travis](https://travis-ci.org/peterpme/sub-in.svg?branch=master)](https://travis-ci.org/peterpme/sub-in)\n\nA tiny (115B) find-and-replace utility for strings in Javascript.\n\n# Installation\n\nIf you're using `Yarn`:\n```sh\nyarn add sub-in\n```\n\nIf you're using `npm`:\n\n```sh\nnpm install sub-in\n```\n\n# Usage\n\nCreate a string with any number of placeholders: `$0`, `$1`, `$2`, `$3`, `$4`, etc. Placeholders are zero based:\n\n- `$0` = `['Peter']` (Peter)\n- `$1` = `['Tom', 'Peter']` (Peter)\n- `$2` = `['Tom', 'John', 'Peter']` (Peter)\n\n```es6\nconst greeting = 'Hey $0, how are you doing?'\nsubIn(greeting, ['Peter'])\n\n// Hey Peter, how are you doing?\n```\n\n```es6\nconst friends = '$0, $1 and $2 are my friends.'\nsubIn(friends, ['Jake', 'Tom', 'Zack'])\n\n// Jake, Tom and Zack are my friends\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterpme%2Fsub-in","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterpme%2Fsub-in","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterpme%2Fsub-in/lists"}