# wp-plugin-installer

> Experimental package for installing WordPress plug-ins with Node.js

Latest version **0.0.2** (published 2022-02-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install wp-plugin-installer
pnpm add wp-plugin-installer
yarn add wp-plugin-installer
bun add wp-plugin-installer
```

## 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.2 |
| Published | 2022-02-25 |
| First published | 2022-02-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Roy Koeleman |
| Maintainers | roywebtify |

## Links

- npm: https://www.npmjs.com/package/wp-plugin-installer
- Repository: https://github.com/RoyWebtify/wp-plugin-installer
- Homepage: https://github.com/RoyWebtify/wp-plugin-installer#readme
- Issues: https://github.com/RoyWebtify/wp-plugin-installer/issues
- npm.io page: https://npm.io/package/wp-plugin-installer

## Dependencies (3)

- [axios](https://npm.io/package/axios.md) ^0.26.0
- [form-data](https://npm.io/package/form-data.md) ^4.0.0
- [set-cookie-parser](https://npm.io/package/set-cookie-parser.md) ^2.4.8

## Recent versions

- 0.0.2 (latest) — 2022-02-25
- 0.0.1 — 2022-02-25

## README

# wp-plugin-installer
Experimental package for installing WordPress plug-ins with Node.js

## Installing
Using npm:
```
$ npm install --save wp-plugin-installer
```

## Example
### Loading
```javascript
const installer = require('wp-plugin-installer');
```

### Logging in
Before you can install plug-ins you have to authenticate with the website. This is done using the async `login` function:
```javascript
await installer.login({
  url: 'https://wordpress.local',
  user: 'username/email',
  password: 'password',
});
```

### Installing plug-ins
After authenticating you can install plug-ins with the async `install` function:
```javascript
const pluginFile = fs.createReadStream('./plugin.zip');
await installer.install(pluginFile);
```
The plug-in will be installed on the website and will be activated automatically. To change this behaviour you can use the `activate` option:
```javascript
const pluginFile = fs.createReadStream('./plugin.zip');
await installer.install(pluginFile, {
  activate: false,
});
```

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