{"id":20436521,"url":"https://github.com/codeeshop-oc/get-script-tag","last_synced_at":"2026-04-18T10:34:37.260Z","repository":{"id":107806744,"uuid":"466040468","full_name":"codeeshop-oc/get-script-tag","owner":"codeeshop-oc","description":"Get script tags and attributes from String","archived":false,"fork":false,"pushed_at":"2023-11-13T10:23:25.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-19T13:04:27.676Z","etag":null,"topics":["javascript","js","mjs","npm","npm-package"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/get-script-tag","language":"JavaScript","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/codeeshop-oc.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2022-03-04T08:21:38.000Z","updated_at":"2023-04-11T15:45:49.000Z","dependencies_parsed_at":"2023-11-13T11:43:23.233Z","dependency_job_id":null,"html_url":"https://github.com/codeeshop-oc/get-script-tag","commit_stats":{"total_commits":5,"total_committers":2,"mean_commits":2.5,"dds":0.4,"last_synced_commit":"b4c4be0a7a95cd07791fb3ca3a95c503eaef931a"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/codeeshop-oc/get-script-tag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeeshop-oc%2Fget-script-tag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeeshop-oc%2Fget-script-tag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeeshop-oc%2Fget-script-tag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeeshop-oc%2Fget-script-tag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeeshop-oc","download_url":"https://codeload.github.com/codeeshop-oc/get-script-tag/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeeshop-oc%2Fget-script-tag/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31966043,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"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":["javascript","js","mjs","npm","npm-package"],"created_at":"2024-11-15T08:44:25.661Z","updated_at":"2026-04-18T10:34:37.238Z","avatar_url":"https://github.com/codeeshop-oc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Get Script Tag\n\n\u003e Get script tags and attributes from String.\n\n[![Latest Stable Version](https://img.shields.io/npm/v/get-script-tag.svg)](https://www.npmjs.com/package/get-script-tag) [![Total Downloads](https://img.shields.io/npm/dt/get-script-tag.svg)](https://npm-stat.com/charts.html?package=get-script-tag)\n[![license](https://img.shields.io/badge/license-MIT-green)](https://github.com/codeeshop-oc/get-script-tag/blob/main/LICENSE)\n[![PRs welcome](https://img.shields.io/badge/PRs-welcome-ff69b4.svg)](https://github.com/codeeshop-oc/get-script-tag/issues?\u0026q=is%3Aissue+is%3Aopen)\n![Downloads Monthly](https://img.shields.io/npm/dm/get-script-tag.svg)\n\n## Installation\n\nvia npm\n\n```bash\nnpm install get-script-tag\n```\n\nvia yarn\n\n```bash\nyarn add get-script-tag\n```\n\nvia pnpm\n\n```bash\npnpm add get-script-tag\n```\n\n\n## API\n`get-script-tag` get all the a `script` tags and its `attributes`.\n\n`require('get-script-tag')` returns a Object of the following interface:  `{getScriptTags: Function, getScriptTag: Function, getScriptAttributes: Function}`\n\n### htmlString\nAny HTML String that you have to fetch `script` tags from.\n\n## Example Usage\n\n```javascript\nconst GetStringTag = require('get-script-tag')\nlet htmlStr = `\u003cp\u003eYou have the Script Tags \u003cscript type=\\\"text/javascript\\\" async=\\\"async\\\" src=\\\"//web.webformscr.com/apps/fc3/build/default-handler.js\\\" sp-form-id=\\\"YOUR_ID\\\"\u003e\u003c/script\u003e\u003c/p\u003e`\n\n// Array of All Script Tags\nconst scripts = GetStringTag.getScriptTags(htmlStr)\nconsole.log(scripts)\n\n// Individual Script Tag with Index\nconst script = GetStringTag.getScriptTag(htmlStr, 0)\nconsole.log(script, 'Index Script')\n\n// Fetching Script Tag Attributes from All Script Tags\nfor (var i = scripts.length - 1; i \u003e= 0; i--) {  \n  console.log(GetStringTag.getScriptAttributes(scripts[i]))\n}\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeeshop-oc%2Fget-script-tag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeeshop-oc%2Fget-script-tag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeeshop-oc%2Fget-script-tag/lists"}