# wrathjs

> Simplified PhantomJs for node

Latest version **0.1.0** (published 2015-07-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install wrathjs
pnpm add wrathjs
yarn add wrathjs
bun add wrathjs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2015-07-13 |
| First published | 2015-06-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | nytr0gen |
| Maintainers | nytr0gen |
| Keywords | request, phantom, phantomjs |

## Links

- npm: https://www.npmjs.com/package/wrathjs
- Repository: https://github.com/nytr0gen/wrathjs
- Homepage: https://github.com/nytr0gen/wrathjs#readme
- Issues: https://github.com/nytr0gen/wrathjs/issues
- npm.io page: https://npm.io/package/wrathjs

## Dependencies (3)

- [deasync](https://npm.io/package/deasync.md) ^0.1.0
- [bluebird](https://npm.io/package/bluebird.md) ^2.9.27
- [node-phantom-simple](https://npm.io/package/node-phantom-simple.md) ^2.0.1

## Recent versions

- 0.1.0 (latest) — 2015-07-13
- 0.0.10 — 2015-07-10
- 0.0.9 — 2015-07-02
- 0.0.8 — 2015-06-17
- 0.0.7 — 2015-06-17
- 0.0.6 — 2015-06-15
- 0.0.5 — 2015-06-12
- 0.0.4 — 2015-06-11
- 0.0.3 — 2015-06-09
- 0.0.2 — 2015-06-08
- 0.0.1 — 2015-06-04

## README

# WrathJs - Simplified PhantomJs for node

WrathJs is a phantomjs bridge for node with simplified api for easy testing. It injects jQuery by default. Did I mention it uses promises? It does ^^

WrathJs is a wrapper for node-phantom-simple.

```
npm install --save wrathjs
```

## API

```
page.open(url) -> Promise(status)

page.get(name) -> Promise(result)

page.set(name, value) -> Promise(null)

page.evaluate(fn, ...args) -> Promise(result)
// fn to be run in phantomjs context

page.click(selector) -> null
page.focus(selector) -> null
page.type(selector, text, delay) -> null
// delay between writing letters {default: 80}

page.render(file, selector = null) -> Promise(null)
// Renders full page without selector

page.waitClick(selector = null) -> Promise(null)
// Clicks on selector if it gets one
// Then waits for the new page to load

page.wait() -> Promise(null)

page.close() -> null
```

## Examples
You can find more examples in tests folder

```
var wrath = new Wrathjs();
page = wrath.create();

page.open('http://www.google.com').then(function () {
    this.type('[name=q]', 'valoare');
    this.click('[name=btnI]');

    return this.waitClick();
}).then(function() {
    // console.log('Page title is', result);

    return this.render('poza.jpg');
}).catch(function(err) {
    console.log(err.stack);
}).finally(function() {
    console.log('exit');
    wrath.exit();
});

```

---
_Source: https://npm.io/package/wrathjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
