{"id":30180929,"url":"https://github.com/streamich/puppet-master","last_synced_at":"2025-09-23T03:45:22.658Z","repository":{"id":57156624,"uuid":"149763264","full_name":"streamich/puppet-master","owner":"streamich","description":"Executes Node.js function in a Chrome browser and returns result","archived":false,"fork":false,"pushed_at":"2019-12-29T16:36:51.000Z","size":173,"stargazers_count":5,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T13:42:35.609Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/streamich.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}},"created_at":"2018-09-21T12:54:25.000Z","updated_at":"2023-03-09T11:45:32.000Z","dependencies_parsed_at":"2022-08-30T05:05:23.808Z","dependency_job_id":null,"html_url":"https://github.com/streamich/puppet-master","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/streamich/puppet-master","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamich%2Fpuppet-master","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamich%2Fpuppet-master/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamich%2Fpuppet-master/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamich%2Fpuppet-master/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/streamich","download_url":"https://codeload.github.com/streamich/puppet-master/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamich%2Fpuppet-master/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269779669,"owners_count":24474597,"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-08-10T02:00:08.965Z","response_time":71,"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":[],"created_at":"2025-08-12T08:06:08.003Z","updated_at":"2025-09-23T03:45:17.597Z","avatar_url":"https://github.com/streamich.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# puppet-master\n\n- Execute Node.js code in Chrome using [`puppeteer`](https://github.com/GoogleChrome/puppeteer).\n- Bundles Node.js module into Chrome using [`parcel`](https://github.com/parcel-bundler/parcel).\n\nImport `execute` function.\n\n```js\nconst {execute} = require('puppet-master');\n```\n\nGet Chrome `location.href` and interact with DOM APIs.\n\n```js\nawait execute(() =\u003e window.location.href);\n// about:blank\n\nawait execute(() =\u003e {\n  const div = document.createElement('div');\n  div.id = 'test';\n  div.innerHTML = 'Hello...';\n  document.body.appendChild(div);\n  const el = document.getElementById('test');\n\n  return el.innerHTML;\n});\n// Hello...\n```\n\nExecute Node.js module in Chrome, also provide arguments:\n\n```js\n// my-module.js\nexport.add = (a, b) =\u003e a + b;\n\n// index.js\nconst func = ({add}, [a, b]) =\u003e add(a, b);\nawait execute({\n  func,\n  args: [1, 2],\n  module: __dirname + '/my-module.js',\n});\n// 3\n```\n\nExecute `fetch` from Chrome.\n\n```js\nawait execute(async () =\u003e {\n  const response = await fetch('https://api.github.com/users/octocat');\n  return await response.json();\n});\n// { login: 'octocat', ...\n```\n\n## Options\n\n```js\nawait execute({\n  func, // Function to execute. It receives two arguments: module and args.\n  module: __dirname + '/module.js', // Path to module, which to evaluate and provide to function.\n  args: [1, 2], // Arguments to pass to the function as the second argument.\n  browserOptions, // Puppeteer browser options.\n  parcelOptions, // Parcel options.\n  debug: false, // If true will open browser and not close it.\n});\n```\n\n\n## License\n\n[Unlicense](./LICENSE) \u0026mdash; public domain.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreamich%2Fpuppet-master","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstreamich%2Fpuppet-master","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreamich%2Fpuppet-master/lists"}