{"id":15853310,"url":"https://github.com/omrilotan/paraphrase","last_synced_at":"2025-10-17T14:09:42.117Z","repository":{"id":40554546,"uuid":"218786509","full_name":"omrilotan/paraphrase","owner":"omrilotan","description":"🧩 Create flavoured string template interpolation","archived":false,"fork":false,"pushed_at":"2024-10-24T10:28:37.000Z","size":37,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-14T14:53:20.700Z","etag":null,"topics":["interpolation","javascript","phrase","replace","string"],"latest_commit_sha":null,"homepage":"https://omrilotan.com/paraphrase","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/omrilotan.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-31T14:34:26.000Z","updated_at":"2025-02-05T08:12:35.000Z","dependencies_parsed_at":"2024-06-19T01:50:57.463Z","dependency_job_id":"c5588e60-5728-478e-8f43-b87bceb3a6e0","html_url":"https://github.com/omrilotan/paraphrase","commit_stats":{"total_commits":19,"total_committers":6,"mean_commits":"3.1666666666666665","dds":0.631578947368421,"last_synced_commit":"f8a6162e498530d49f9ad29f392c4785e99c361c"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/omrilotan/paraphrase","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omrilotan%2Fparaphrase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omrilotan%2Fparaphrase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omrilotan%2Fparaphrase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omrilotan%2Fparaphrase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/omrilotan","download_url":"https://codeload.github.com/omrilotan/paraphrase/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omrilotan%2Fparaphrase/sbom","scorecard":{"id":706505,"data":{"date":"2025-08-11","repo":{"name":"github.com/omrilotan/paraphrase","commit":"69c9e76d6af925f8d3b8132edf4b097c1a007819"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/14 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/omrilotan/paraphrase/main.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/main.yml:21","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":9,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/main.yml:9","Warn: jobLevel 'contents' permission set to 'write': .github/workflows/main.yml:10","Warn: no topLevel permission defined: .github/workflows/main.yml:1"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: The Unlicense: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T06:44:25.285Z","repository_id":40554546,"created_at":"2025-08-22T06:44:25.285Z","updated_at":"2025-08-22T06:44:25.285Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279359966,"owners_count":26155232,"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","status":"online","status_checked_at":"2025-10-17T02:00:07.504Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["interpolation","javascript","phrase","replace","string"],"created_at":"2024-10-05T19:04:09.656Z","updated_at":"2025-10-17T14:09:42.071Z","avatar_url":"https://github.com/omrilotan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# paraphrase [![](https://img.shields.io/npm/v/paraphrase.svg)](https://www.npmjs.com/package/paraphrase)\n\n## 🧩 Create flavoured string template interpolation\n\n[![](https://github.com/omrilotan/paraphrase/workflows/Publish/badge.svg)](https://github.com/omrilotan/paraphrase/actions) [![](https://badge.runkitcdn.com/paraphrase.svg)](https://runkit.com/omrilotan/paraphrase) [![](https://badgen.net/bundlephobia/minzip/paraphrase)](https://bundlephobia.com/result?p=paraphrase)\n\n```\nnpm i paraphrase\n```\n\nCreates new paraphrase method instance\n\n```js\nimport { paraphrase } from \"paraphrase\";\nconst phrase = paraphrase(/\\${([^{}]*)}/gm); // Create a new phrase function using a RegExp match\n\nphrase(\"Hello, ${name}\", { name: \"Martin\" }); // Hello, Martin\n```\n\nAcceptable replacements (values) are strings and numbers\n\n### Arguments and Options\n\nOne or more RegExp replacers, an optional options object at the end\n\n| option    | meaning                                                                         | type      | default |\n| --------- | ------------------------------------------------------------------------------- | --------- | ------- |\n| recursive | Should continue to resolve result string until replacements have been exhausted | `Boolean` | `true`  |\n| resolve   | Should resolve dot notations within the template                                | `Boolean` | `true`  |\n| clean     | Should remove unmatched template instances                                      | `Boolean` | `false` |\n\n##### Multiple replacers\n\n```js\nconst phrase = paraphrase(/\\${([^{}]*)}/gm, /\\{{([^{}]*)}}/gm);\n\nphrase(\"Hello, ${firstname} {{lastname}}\", {\n  firstname: \"Martin\",\n  lastname: \"Prince\",\n}); // Hello, Martin Prince\n```\n\n##### Dot notation resolve\n\nTreat dots as part of the key instead of notation marks\n\n```js\nconst phrase = paraphrase(/\\${([^{}]*)}/gm, { resolve: false });\n\nphrase(\"Hello, ${name} ${last.name}\", {\n  name: \"Martin\",\n  \"last.name\": \"Prince\",\n}); // Hello, Martin Prince\n```\n\n##### Unmatched cleanup\n\nRemove unmatched template instances from the result string\n\n```js\nconst phrase = paraphrase(/\\${([^{}]*)}/gm, { clean: true });\n\nphrase(\"Hello, ${firstname} ${lastname}\", { firstname: \"Martin\" }); // Hello, Martin\n```\n\n## Examples\n\n### Objects\n\n```js\nphrase(\"Hello, ${name}\", { name: \"Martin\" }); // Hello, Martin\n```\n\n### Objects with dot notation\n\n```js\nconst user = {\n  name: { first: \"Martin\", last: \"Prince\" },\n};\nphrase(\"Hello, ${name.first} ${name.last}\", user); // Hello, Martin Prince\n```\n\n### Arrays\n\n```js\nphrase(\"Hello, ${0} ${1}\", [\"Martin\", \"Prince\"]); // Hello, Martin Prince\n```\n\n### Spread arguments\n\n```js\nphrase(\"Hello, ${0} ${1}\", \"Martin\", \"Prince\"); // Hello, Martin Prince\n```\n\n## Premade\n\n### dollar `${...}`\n\n```js\nimport { dollar as phrase } from \"paraphrase\";\n\nphrase(\"Hello, ${name}\", { name: \"Martin\" }); // Hello, Martin\n```\n\n### double `{{...}}`\n\n```js\nimport { double as phrase } from \"paraphrase\";\n\nphrase(\"Hello, {{name}}\", { name: \"Martin\" }); // Hello, Martin\n```\n\n### single `{...}`\n\n```js\nimport { single as phrase } from \"paraphrase\";\n\nphrase(\"Hello, {name}\", { name: \"Martin\" }); // Hello, Martin\n```\n\n### percent `%{...}` (i18n style)\n\n```js\nimport { percent as phrase } from \"paraphrase\";\n\nphrase(\"Hello, %{name}\", { name: \"Martin\" }); // Hello, Martin\n```\n\n### hash `#{...}` (ruby style)\n\n```js\nimport { hash as phrase } from \"paraphrase\";\n\nphrase(\"Hello, #{name}\", { name: \"Martin\" }); // Hello, Martin\n```\n\n### loose. Accommodate all of the above\n\n```js\nimport { loose as phrase } from 'paraphrase';\n\nphrase('Hello, #{name.first} {name.last}', {name: { first: 'Martin', last: 'Prince' }); // Hello, Martin Prince\n```\n\n## patterns\n\nA paraphrase instance exposes view to its patterns array (immutable)\n\n```js\nimport { hash as phrase } from \"paraphrase\";\n\nphrase.patterns; // [ /#{([^{}]*)}/gm ]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomrilotan%2Fparaphrase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomrilotan%2Fparaphrase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomrilotan%2Fparaphrase/lists"}