# @suchipi/webview

> This package wraps https://github.com/suchipi/webview so it can be distributed on npm and run from node.

Latest version **0.2.1** (published 2020-09-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @suchipi/webview
pnpm add @suchipi/webview
yarn add @suchipi/webview
bun add @suchipi/webview
```

Provides the command `webview`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2020-09-22 |
| First published | 2020-09-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 30.9 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | suchipi |

## Links

- npm: https://www.npmjs.com/package/@suchipi/webview
- npm.io page: https://npm.io/package/@suchipi/webview

## Dependencies (1)

- [yargs-parser](https://npm.io/package/yargs-parser.md) ^20.2.0

## Recent versions

- 0.2.1 (latest) — 2020-09-22
- 0.2.0 — 2020-09-22
- 0.1.1 — 2020-09-21
- 0.1.0 — 2020-09-21

## README

# `@suchipi/webview`

This package wraps https://github.com/suchipi/webview so it can be distributed on npm and run from node.

## Installation

As a global CLI application:

```
npm i -g @suchipi/webview
```

As a node module:

```
npm i --save @suchipi/webview
```

## Usage (CLI)

```
webview
webview -d ./public --title "My Site"
webview --url http://google.com --width 1024 --height 768
webview --help
```

## Usage (Node)

```js
var webview = require("@suchipi/webview");

// webview is an object with this shape:
// {
//   binaryPath: string, // The absolute path to the binary for your platform
//   optionsToArgv: Function, // Convert an options object to the appropriate argv to pass to the binary
//   spawn: Function, // use child_process.spawn to run the binary
//   spawnSync: Function, // use child_process.spawnSync to run the binary
//   exec: Function, // use child_process.execFile to run the binary
//   execSync: Function, // use child_process.execFileSync to run the binary
// }

// You can either use webview.binaryPath and webview.optionsToArgv to spawn it yourself:
var child = require("child_process").spawn(
  webview.binaryPath,
  optionsToArgv({
    title: "My App",
    width: 1024,
    height: 768,
    dir: "./public",
  }),
  {
    cwd: process.cwd(),
  }
);

// or you can use the provided helper functions to spawn it using child_process.
// Note that the helper function accepts webview options and spawn options in the same object.
var child = webview.spawn({
  // options for webview
  title: "My App",
  width: 1024,
  height: 768,
  dir: "./public",

  // options for child_process.spawn
  cwd: process.cwd(),
});
```

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