{"id":22285116,"url":"https://github.com/fardog/ghostface","last_synced_at":"2025-07-28T22:31:04.534Z","repository":{"id":29300732,"uuid":"32833832","full_name":"fardog/ghostface","owner":"fardog","description":"Evaluate Javascript in PhantomJS, and print the output.","archived":false,"fork":false,"pushed_at":"2015-09-25T07:24:42.000Z","size":532,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-01T07:36:44.534Z","etag":null,"topics":["browser","headless-testing","phantomjs","testing"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/ghostface","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fardog.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":"2015-03-25T00:47:45.000Z","updated_at":"2019-01-30T19:19:12.000Z","dependencies_parsed_at":"2022-09-04T09:41:55.799Z","dependency_job_id":null,"html_url":"https://github.com/fardog/ghostface","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fardog%2Fghostface","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fardog%2Fghostface/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fardog%2Fghostface/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fardog%2Fghostface/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fardog","download_url":"https://codeload.github.com/fardog/ghostface/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227961889,"owners_count":17847836,"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":["browser","headless-testing","phantomjs","testing"],"created_at":"2024-12-03T16:51:11.899Z","updated_at":"2024-12-03T16:51:12.535Z","avatar_url":"https://github.com/fardog.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ghostface\n\nEvaluate javascript in PhantomJS, and print the output.\n\n[![Build Status][buildstatusimg]][buildstatus]\n[![npm install][npminstallimg]][npminstall]\n[![js-standard-style][jsstandardimg]][jsstandard]\n\nInspired by [jsdom-eval][], this module\nmakes it trivial to run tests in a headless browser.\n\n## Installation\n\n`npm install -g ghostface` will expose the `ghostface` command in your\nenvironment.\n\n`ghostface` does *not* include [phantomjs][] as a dependency; you should install\nthat however works best in your environment, and `ghostface` will find it so\nlong as it exists in your `$PATH`.\n\n`ghostface` supports phantomjs versions `^1.9.0` or `^2.0.0`.\n\n## Example\n\nImagine a [browserify][] project that you're testing using [tape][]:\n\n```javascript\n// file: test.js\n\nvar test = require('tape')\n\ntest('always passes', function(t) {\n  t.plan(1)\n  t.pass()\n})\n```\n\nRun it with `ghostface`:\n\n```bash\n$ browserify test.js | ghostface | tap-set-exit\n```\n\nSee the output printed to the console:\n\n```\nTAP version 13\n# always passes\nok 1 (unnamed assert)\n\n1..1\n# tests 1\n# pass  1\n\n# ok\n```\n\n**Note:** In the example above, we pipe output to [tap-set-exit][], which parses\nTAP output and sets the correct exit codes; `ghostface` is just evaluating\njavascript, it doesn't know/care what the output is, or how to set the correct\nexit codes.\n\n## Usage\n\n```\n$ ghostface --help\n\nUsage: ghostface [options] [file]\n\nfile    Javascript file to be evaluated\n\nOptions:\n  -h --html            The HTML file to be used as the page template\n  -t --timeout         Milliseconds to wait for output before stopping execution. Default 1000\n  -f --forever         Ignore the timeout and wait forever\n  -p --phantomPath     Specify the path to the phantomjs executable\n  --help               Show this message\n  --version            Print version and quit\n```\n\nYou can specify the JS file to be evaluated, or pipe a JS file directly into\n`ghostface`. For an imaginary `file.js` in the current directory, these two\ncommands are equivalent:\n\n```bash\n$ ghostface file.js\n$ cat file.js | ghostface\n```\n\nThe JS you are evaluating will be done in a blank web page. If you want to\nprovide your own context, use the `--html \u003cfilename\u003e` option to load your own\nhtml; the JS will be evaluated after the page loads.\n\nBy default, execution is stopped if no console output is seen for over 1000ms.\nYou can override this timeout with `--timeout \u003cms\u003e`, or choose to run forever\nwith `--forever`. Note you will have to send a `SIGHUP` to end execution.\n\n## License\n\nThis project is licensed under the Apache License, Version 2.0. See\n[LICENSE](./LICENSE) for the full license.\n\n[jsdom-eval]: https://github.com/hayes/jsdom-eval\n[tape]: https://github.com/substack/tape\n[browserify]: https://github.com/substack/node-browserify\n[tap-set-exit]: http://npm.im/tap-set-exit\n[phantomjs]: http://phantomjs.org/\n\n[buildstatus]: https://travis-ci.org/fardog/ghostface\n[npminstall]: https://www.npmjs.org/package/ghostface\n[jsstandard]: https://github.com/feross/standard\n[buildstatusimg]: http://img.shields.io/travis/fardog/ghostface/master.svg?style=flat-square\n[npminstallimg]: http://img.shields.io/npm/dm/ghostface.svg?style=flat-square\n[jsstandardimg]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffardog%2Fghostface","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffardog%2Fghostface","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffardog%2Fghostface/lists"}