{"id":15285261,"url":"https://github.com/tkdn/chroco","last_synced_at":"2026-01-04T23:05:51.255Z","repository":{"id":57198362,"uuid":"103412488","full_name":"tkdn/chroco","owner":"tkdn","description":"[experimental] Chroco operates `puppeteer` with commandable, pluggable settings.","archived":false,"fork":false,"pushed_at":"2017-10-12T06:54:42.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T01:42:44.647Z","etag":null,"topics":["chrome","cli","experimental","headless","puppeteer","scenario"],"latest_commit_sha":null,"homepage":"","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/tkdn.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}},"created_at":"2017-09-13T14:49:12.000Z","updated_at":"2022-12-07T11:27:51.000Z","dependencies_parsed_at":"2022-09-16T14:10:27.971Z","dependency_job_id":null,"html_url":"https://github.com/tkdn/chroco","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkdn%2Fchroco","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkdn%2Fchroco/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkdn%2Fchroco/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkdn%2Fchroco/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tkdn","download_url":"https://codeload.github.com/tkdn/chroco/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245152738,"owners_count":20569399,"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":["chrome","cli","experimental","headless","puppeteer","scenario"],"created_at":"2024-09-30T15:03:57.575Z","updated_at":"2026-01-04T23:05:51.187Z","avatar_url":"https://github.com/tkdn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chroco\n\n\u003e `Chroco` operates \\`[puppeteer](https://github.com/GoogleChrome/puppeteer/)\\` with commandable, pluggable settings.  \n\u003e `Chroco` [pronounced as _\"kuroko\"_] means _\"black person\"/\"black clothes\"_  in Japanese. [Wikipedia: 黒子](https://en.wikipedia.org/wiki/Kuroko)  \n\u003e **[Work in Progress] It's a experimental package. Help us.**\n\n## Installation and Usage\n\n### Installation\n\n```bash\n$ yarn add chroco\n# or\n$ npm i chroco\n```\n\n### Programmable Usage\n\n```js\nconst { excecuter } = require('chroco')\nexecutor({\n  // your options, settings and scenarios\n})\n```\n\n### CLI Usage\n\n```bash\n$ chroco # default, detect `.chrocorc`\n# or\n$ chroco --config ./path/to/.chrocorc\n# or (if you want, you can use yaml file.)\n$ chroco --config .chroco.yml\n```\n\nDefault value is `.chrocorc`.  \nrefs: [.chrocorc](./sample/.chrocorc) or [.chrocorc.yml](./sample/.chrocorc.yml)\n\n### Chroco Configure\n\nConfigure should be `Object`.\n\n|parms|detail|type|val|required|\n|-----|------|----|---|--------|\n|`options`|refs: [puppeteer launch options](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions)|Object| - |none|\n|`options.logLevel`|Chroco original options| Array.\\\u003cstring\\\u003e\\|string | `['info', 'warn', 'error']`|none|\n|emulateOptions|refs: [puppeteer emulate options](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pageemulateoptions)|Object| - |none|\n|receivers|Your Customized Receiver, [sample](./sample/search.js)| Array.\\\u003cFunction\\\u003e | - | none |\n|scenarios|Your commandable, iterable `Array`| Array.\\\u003cObject.\\\u003cFunction\\\u003e.\\\u003cArray\\|Object\\|string\\\u003e| - |required|\n\n\n#### Scenarios \\\u003cArray\\\u003e\n\n- `scenarios[n].\u003cFunction\u003e` is puppeteer's \"`class: Page`\" method.\n- `scenarios[n].\u003cFunction\u003e.\u003cArray|Object|string\u003e` is `params` for above method.\n\n```js\n{\n  scenarios: [\n    goto: [\n      'https://www.google.com',\n      { waitUntil: 'load' }\n    ],\n    screenshot: {\n      path: 'temp/screenshot.png',\n      fullPage: true\n    }\n  ]\n}\n```\n\nThis commands executes ...\n\n```js\n/**\n * Before commands executed,\n * Chroco executes launching Chrome instance and\n * delivering `puppeteer's page: class` to commands as internal param. \n */\n\n// const chrome = await puppeteer.launc()\n// const page = await chrome.newPage()\n\nawait page.goto(\n  'https://www.google.com',\n  { waitUntil: 'load' }\n)\nawait page.screenshot({\n  path: 'temp/screenshot.png',\n  fullPage: true\n})\n```\n\nEach Scenario's key is mapped to [`class: Page`](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#class-page) method with `puppeteer`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkdn%2Fchroco","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftkdn%2Fchroco","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkdn%2Fchroco/lists"}