{"id":22305700,"url":"https://github.com/muratgozel/metapatcher","last_synced_at":"2026-03-02T04:04:11.911Z","repository":{"id":42931925,"uuid":"239168071","full_name":"muratgozel/metapatcher","owner":"muratgozel","description":"HTML document head management including meta tags, social media tags, icons and JSONLD expressions across devices.","archived":false,"fork":false,"pushed_at":"2025-01-16T18:24:52.000Z","size":1605,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-18T07:45:56.747Z","etag":null,"topics":["html-document","html-head-generator","jsonld","meta-tags","opengraph-tags","social-media-icons"],"latest_commit_sha":null,"homepage":null,"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/muratgozel.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":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"muratgozel","patreon":"muratgozel","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-02-08T16:52:58.000Z","updated_at":"2025-01-16T18:23:49.000Z","dependencies_parsed_at":"2024-05-14T11:26:30.742Z","dependency_job_id":"32a4a5a2-b266-409f-b5e1-ab91a7cd2969","html_url":"https://github.com/muratgozel/metapatcher","commit_stats":{"total_commits":16,"total_committers":1,"mean_commits":16.0,"dds":0.0,"last_synced_commit":"ac06197c342d4676d1edc226983baa88cbbddfa9"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/muratgozel/metapatcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratgozel%2Fmetapatcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratgozel%2Fmetapatcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratgozel%2Fmetapatcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratgozel%2Fmetapatcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muratgozel","download_url":"https://codeload.github.com/muratgozel/metapatcher/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratgozel%2Fmetapatcher/sbom","scorecard":{"id":668277,"data":{"date":"2025-08-11","repo":{"name":"github.com/muratgozel/metapatcher","commit":"737c125fd376bab1a49f0ba7e44eaa98481cb55d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/28 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":"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":"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":"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":"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":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: topLevel 'packages' permission set to 'write': .github/workflows/release.yml:21","Warn: topLevel 'contents' permission set to 'write': .github/workflows/release.yml:17","Info: no jobLevel write permissions found"],"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":"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/release.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/muratgozel/metapatcher/release.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/release.yml:30","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":"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":"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":"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: MIT License: 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 'master'"],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 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"}},{"name":"Vulnerabilities","score":0,"reason":"20 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-xffm-g5w8-qvg7","Warn: Project is vulnerable to: GHSA-x4c5-c7rf-jjgv","Warn: Project is vulnerable to: GHSA-h5c3-5r3r-rr8q","Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38","Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc","Warn: Project is vulnerable to: GHSA-8gvc-j273-4wm5","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8cj5-5rvv-wf4v","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-cxrh-j4jr-qwg3","Warn: Project is vulnerable to: GHSA-vg6x-rcgg-rjx6","Warn: Project is vulnerable to: GHSA-x574-m823-4x7w","Warn: Project is vulnerable to: GHSA-4r4m-qw57-chr8","Warn: Project is vulnerable to: GHSA-xcj6-pq6g-qj4x","Warn: Project is vulnerable to: GHSA-356w-63v5-8wf4","Warn: Project is vulnerable to: GHSA-859w-5945-r5v3","Warn: Project is vulnerable to: GHSA-9crc-q9x8-hgqq"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T18:57:31.955Z","repository_id":42931925,"created_at":"2025-08-21T18:57:31.955Z","updated_at":"2025-08-21T18:57:31.955Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29992286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"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":["html-document","html-head-generator","jsonld","meta-tags","opengraph-tags","social-media-icons"],"created_at":"2024-12-03T19:12:49.536Z","updated_at":"2026-03-02T04:04:11.881Z","avatar_url":"https://github.com/muratgozel.png","language":"TypeScript","readme":"# metapatcher\nHTML document head management library with convenient api. Manage social media tags, icons, device specific tags and event structured data with html meta tags and JSONLD documents. Supports both browser and server environments. Fully typed.\n\nIt injects head tags based on features you enabled upon start. The features are device, browser, platform specific. You give the data you have on page load and it injects appropriately.\n- `structuredData` controls tags related to the [Google Search Structured Data](https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data).\n- `openGraphTags` controls [Open Graph](https://ogp.me) tags which many social media sites rely to fetch page data\n- `webAppManifest` controls tags related to [Web Application Manifest](https://www.w3.org/TR/appmanifest/) spec.\n- `twitterTags` controls meta tags related to [Twitter Cards](https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/abouts-cards)\n- `msTags` controls Microsoft device and browser specific tags including name, description and icons\n- `appleTags` controls Apple device specific tags such as icons, name and style\n\n## Install\n```sh\nnpm install metapatcher\n```\n\n## Usage\n### Import\n```js\nimport { metapatcher } from 'metapatcher'\n// or const { metapatcher } = require('metapatcher') for commonjs\n```\nor inject with script tag:\n```html\n\u003cscript type=\"module\" src=\"https://cdn.jsdelivr.net/npm/metapatcher@4/dist/index.js\"\u003e\u003c/script\u003e\n```\n\n### Configure\nAll features mentioned above are enabled by default. You can disable some of them:\n```js\nmetapatcher.configure(['openGraphTags', 'structuredData', 'twitterTags', 'msTags', 'appleTags'], { idPrefix: 'metapatcher' })\n// configure also does some injections so you gonna call it anyway\nmetapatcher.configure()\n```\n\n### Basic, High Level Methods\nYou have to use at least the following methods to create satisfying frontends:\n```js\n// all parameters are optional\nmetapatcher.setProjectDetails({\n    favicon: '/path/favicon.ico',\n    name: 'My Project',\n    url: 'https://example.com',\n    robots: 'noindex, nofollow', // or \"all\" for example\n    logo: '/path/logo.png',\n    themeColor: '#333333',\n    twitterSite: '@twitter',\n    safariPinnedTab: { href: '/path/mark.svg', color: '#333333' },\n    // icons need to follow this naming: *-[width]x[height].ext\n    icons: ['/path/icon-16x16.png', '/path/icon-512x512.png', '/path/icon-150x150.png']\n})\n```\nAll of the parameters above are optional and has their own individual methods such as `setFavicon`, `setIcons` or `setName`.\n\nConsider also the following methods at the project level:\n```js\nmetapatcher.setMsApplicationConfig (param: string | MetapatcherMsApplicationConfigAttrs)\nmetapatcher.setAppleStatusBarStyle (content: 'default' | 'black' | 'black-translucent' = 'default')\nmetapatcher.addPreload (param: string | MetapatcherPreloadAttrs)\nmetapatcher.addPrefetch (param: string | MetapatcherPrefetchAttrs)\nmetapatcher.addPreconnect (param: string | MetapatcherPreconnectAttrs)\nmetapatcher.addDnsPrefetch (param: string | MetapatcherDnsPrefetchAttrs)\n```\nUse the following methods from page to page:\n```js\n// all parameters are optional\nmetapatcher.setPageDetails({\n    title: 'Page | Project Name',\n    description: 'Lorem ipsum.',\n    path: '/en-us/some/page',\n    image: '/media/page-cover.jpg',\n    // both xx_XX and xx-XX syntax are okay for locales\n    locale: 'en_US',\n    canonical: 'https://example.com/en-us/some/page',\n    // both xx_XX and xx-XX syntax are okay for hreflang\n    localVersions: [\n        { hreflang: 'en-US', href: '/en-us/some/page' }, \n        { hreflang: 'tr-TR', href: '/tr-tr/some/page' }],\n    breadcrumb: [\n        { title: 'Page', url: '/en-us/some/page' },\n        { title: 'Some', url: '/en-us/some' },\n        { title: 'Home', url: '/en-us' }\n    ]\n})\n```\nAll of the parameters above are optional and has their own individual methods such as `setPageTitle` or `setBreadcrumb`.\n\nConsider also the following methods at the page level:\n```js\nmetapatcher.setMobileVariant (param: string | MetapatcherMobileVariantLinkAttrs)\n```\n\nIt will inject appropriate meta tags, link tags, jsonld scripts for specific platforms and devices depending on the enabled features.\n\nTo set any other kind of meta tags:\n```js\nmetapatcher.setMeta('google', 'notranslate')\n```\n\n### Server-side Usage\nThe library has a simple `isDomAvailable` property which get its value upon init by a simple check `typeof document !== 'undefined'`. This property decides if the library should inject tags or collect them in memory. So, when you run the library in a non-browser environment, they will be kept in memory. You can print them all with:\n```js\nmetapatcher.dump()\n```\nIt returns:\n```html\n\u003cmeta id=\"metapatcher-msapplication-config\" name=\"msapplication-config\" content=\"none\"\u003e\n\u003cmeta id=\"metapatcher-apple-mobile-web-app-capable\" name=\"apple-mobile-web-app-capable\" content=\"yes\"\u003e\n\u003cmeta id=\"metapatcher-twitter-card\" name=\"twitter:card\" content=\"summary\"\u003e\n...\n```\n\n### Low Level Usage, Custom Tags\nThere are methods that you can use to set custom meta tags, link tags and jsonld scripts without leaving the control of the library.\n\nSet custom tags:\n```js\n// all parameters are optional\nmetapatcher.set('meta', { id: 'my-id', name: 'viewport', content: 'width=device-width, initial-scale=1, viewport-fit=cover' })\n\nmetapatcher.setJsonLd('my-script', { abc: 'def' })\n```\nand remove later if neccessary:\n```js\nmetapatcher.removeOne('link[id=\"my-id\"]')\nmetapatcher.removeMany('link[hreflang]')\n```\n\n### Inject Script and Stylesheet Resources\n```js\nawait metapatcher.setScript({ id: 'my-script', src: 'https://cdn.jsdelivr.net/npm/metapatcher@4/dist/index.js', async: true })\n// wait for global \"metapatcher\" to become available under window\nawait metapatcher.setScript({ id: 'my-script', src: 'https://cdn.jsdelivr.net/npm/metapatcher@4/dist/index.js', async: true }, { waitForLoad: 'metapatcher' })\n\nawait metapatcher.setStylesheet({ id: 'my-style', href: 'https://example.com/style.css' })\n```\n\n### Supports Boolean Attributes\nMany methods takes a parameter to be used as html attrs and you can always provide a boolean value for any attribute to render it as boolean html element attribute:\n```js\nmetapatcher.set('link', { rel: 'manifest', href: '/app.webmanifest', crossorigin: true })\n```\n\n## Contributing\nIf you're interested in contributing, read the [CONTRIBUTING.md](https://github.com/muratgozel/muratgozel/blob/main/CONTRIBUTING.md) first, please.\n\n---\n\nThanks for the attention 💙 Any amount of support on [patreon](https://patreon.com/muratgozel?utm_medium=organic\u0026utm_source=github_repo\u0026utm_campaign=github\u0026utm_content=join_link) or [github](https://github.com/sponsors/muratgozel) will return you back as bug fixes, new features and bits and bytes.\n","funding_links":["https://github.com/sponsors/muratgozel","https://patreon.com/muratgozel","https://patreon.com/muratgozel?utm_medium=organic\u0026utm_source=github_repo\u0026utm_campaign=github\u0026utm_content=join_link"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuratgozel%2Fmetapatcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuratgozel%2Fmetapatcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuratgozel%2Fmetapatcher/lists"}