# @hikaruna/exec-on-dom

> 指定したhtmlファイルを開いた状態のdom環境下で任意のscriptを実行するコマンドです.

Latest version **0.0.1** (published 2018-11-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @hikaruna/exec-on-dom
pnpm add @hikaruna/exec-on-dom
yarn add @hikaruna/exec-on-dom
bun add @hikaruna/exec-on-dom
```

Provides the command `exec-on-dom`.

## 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.0.1 |
| Published | 2018-11-25 |
| First published | 2018-11-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | hikaruna |
| Maintainers | hikaruna |

## Links

- npm: https://www.npmjs.com/package/@hikaruna/exec-on-dom
- npm.io page: https://npm.io/package/@hikaruna/exec-on-dom

## Dependencies (2)

- [argv](https://npm.io/package/argv.md) 0.0.2
- [jsdom](https://npm.io/package/jsdom.md) ^13.0.0

## Recent versions

- 0.0.1 (latest) — 2018-11-25

## README

# exec-on-dom
指定したhtmlファイルを開いた状態のdom環境下で任意のscriptを実行するコマンドです.
reqlに対応しています.

## Installation

```
$ npm install -g hikaruna/exec-on-dom#master
```


## Usage

```
$ exec-on-dom -f xxx.html
> document
Document { location: [Getter/Setter] }
> window
Window { ... }
> Ctrl + D
```

### Repl mode

```$ exec-on-dom -f xxx.html```

### file mode

```$ exec-on-dom -f xxx.html yyy.js```

or

```$ cat yyy.js | exec-on-dom -f xxx.html```

or

```$ exec-on-dom -f xxx.html < yyy.js```

### Eval mode

```$ exec-on-dom -f xxx.html -e "console.log(document);"```

## 備考

渡される変数は以下の2つ

- document
- window

jqueryをrequireして使うこともできる

```
$ npm i jquery
$ exec-on-dom -f xxx.html
> const $ = require('jquery')(window)
> $('h1').text()
'html h1 string'
```

## License
MIT

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