{"id":13548872,"url":"https://github.com/mantoni/phantomic","last_synced_at":"2025-03-19T21:30:29.022Z","repository":{"id":8264083,"uuid":"9715329","full_name":"mantoni/phantomic","owner":"mantoni","description":"Pipe stdin to Phantom.JS","archived":false,"fork":false,"pushed_at":"2017-05-21T08:32:59.000Z","size":88,"stargazers_count":20,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-16T01:29:10.056Z","etag":null,"topics":["console","phantomjs","pipe"],"latest_commit_sha":null,"homepage":null,"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/mantoni.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.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":"2013-04-27T13:53:44.000Z","updated_at":"2019-07-11T16:01:25.000Z","dependencies_parsed_at":"2022-08-07T00:15:20.163Z","dependency_job_id":null,"html_url":"https://github.com/mantoni/phantomic","commit_stats":null,"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mantoni%2Fphantomic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mantoni%2Fphantomic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mantoni%2Fphantomic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mantoni%2Fphantomic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mantoni","download_url":"https://codeload.github.com/mantoni/phantomic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244021751,"owners_count":20385122,"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":["console","phantomjs","pipe"],"created_at":"2024-08-01T12:01:15.467Z","updated_at":"2025-03-19T21:30:28.650Z","avatar_url":"https://github.com/mantoni.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Phantomic\n\n[![SemVer]](http://semver.org)\n[![License]](https://github.com/mantoni/phantomic/blob/master/LICENSE)\n\n- Pipes stdin to [PhantomJS](http://phantomjs.org)\n- Writes script console output to stdout\n- Writes script errors to stderr\n- Exit code 0 if nothing threw, otherwise 1\n\n## Install\n\n```\nnpm install -g phantomic\n```\n\n## Usage\n\nPhantomic does not include PhantomJS itself. Make sure the `phantomjs`\nexecutable is in your `PATH` or specify with `--phantomjs`.\n\n```\nUsage: phantomic [options] [file]\n\nOptions:\n    --debug                Launch the WebKit debugger in a browser\n    --port \u003cnum\u003e           Explicit port binding for temporary web server. If\n                           no port is specified, a random free port is used.\n    --phantomjs \u003cpath\u003e     Use specified phantomjs binary\n    --web-security \u003cbool\u003e  Enables PhantomJS web security and forbids\n                           cross-domain XHR (default is true)\n    --brout                Assume brout is part of the JS\n    --ignore-ssl-errors \u003cbool\u003e  Tell PhantomJS to ignore SSL certificate errors\n                                when network requests are made (default is false)\n    --viewport-width \u003cnum\u003e      Tell PhantomJS about the desired viewport width\n    --viewport-height \u003cnum\u003e     Tell PhantomJS about the desired viewport\n                                height\n\n```\n\nPipe any script to phantomic:\n\n```\nphantomic \u003c ./test.js\n```\n\nOpening a file:\n\n```\nphantomic ./test.js\n```\n\nIf you are using phantomic from a Makefile with a local install, you will have\nto include it in the PATH:\n\n```\nBIN = ./node_modules/.bin\nPATH := $(BIN):$(PATH)\n\ntest:\n  browserify ./test.js | phantomic\n```\n\n## Debugging\n\nPut a `debugger;` statement somewhere and run:\n\n```\nphantomic --debug \u003c ./test.js\n```\n\nThis will open the WebKit inspector in your browser.\n\n## Exit detection\n\nBy default, phantomic will report an error if anything was logged to\n`console.error`. Program termination is detected by observing delays in the\nevent queue and the last log statement that was received.\n\nTo make exit detection more reliable, [brout][] can be used. If brout is part\nof the given script, run phantomic with `--brout` to install handlers for the\n`out`, `err` and `exit` events. Also make sure `process.exit(code)` is called.\n\n## API\n\nYou can use phantomic from your own node scripts like this:\n\n```js\nvar phantomic = require('phantomic');\n\nphantomic(process.stdin, {\n  debug : false,\n  port  : 0,\n  brout : false,\n  'web-security': false,\n  'ignore-ssl-errors': true,\n  'viewport-width': 1024,\n  'viewport-height': 768\n}, function (code) {\n  process.exit(code);\n}).pipe(process.stdout);\n```\n\n## Run the test cases\n\n```\nnpm install\nmake\n```\n\n## Compatibility\n\n- Node 0.10 or later\n- PhantomJS 1.9 / 2.0\n\n## License\n\nMIT\n\n[SemVer]: http://img.shields.io/:semver-%E2%9C%93-brightgreen.svg\n[License]: http://img.shields.io/npm/l/phantomic.svg\n[brout]: https://github.com/mantoni/brout.js\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmantoni%2Fphantomic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmantoni%2Fphantomic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmantoni%2Fphantomic/lists"}