npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@designcontainer/dc-wpe-js-api

v1.2.2

Published

A javascript wrapper for the WPE Api

Downloads

4

Readme

JavaScript wrapper for the WP Engine API

A simple JavaScript wrapper for getting data from your WP Engine installs using their API.

Installing

$ npm install @designcontainer/dc-wpe-js-api

Import

import WpeApi from '@designcontainer/dc-wpe-js-api';

Initialize constructor

Params

  • user {String}: The WP Engine API User.
  • pass {String}: The WP Engine API Password/key.

You should put these variables in a .ENV file!

const wpe = new WpeApi(user, pass);

API

.id

Get WP Engine install ID by name.

Params

  • name {String}: The WP Engine install Name.
  • returns {String}: Returns the WP Engine install ID.

Example

wpe.id(name);

.name

Get WP Engine install name by id.

Params

  • id {String}: The WP Engine install ID.
  • returns {String}: Returns the WP Engine install name.

Example

wpe.name(id);

.domains

Get WP Engine install domains by id.

Params

  • id {String}: The WP Engine install ID.
  • returns {Array}: Returns the WP Engine install domains.

Example

wpe.domains(id);

.phpVersion

Get the PHP version of the WP Engine install by id.

Params

  • id {String}: The WP Engine install ID.
  • returns {String}: Returns the PHP version of the WP Engine install.

Example

wpe.phpVersion(id);

.status

Get the status of the WP Engine install by id.

Params

  • id {String}: The WP Engine install ID.
  • returns {String}: Returns the status of the WP Engine install.

Example

wpe.status(id);

.cname

Get the CNAME of the WP Engine install by id.

Params

  • id {String}: The WP Engine install ID.
  • returns {String}: Returns the CNAME of the WP Engine install.

Example

wpe.cname(id);

.environment

Get the WP Engine install environment by id.

Params

  • id {String}: The WP Engine install ID.
  • returns {String}: Returns the WP Engine install environment.

Example

wpe.environment(id);

.primaryDomain

Get WP Engine primary install domain by id.

Params

  • id {String}: The WP Engine install ID.
  • returns {String}: Returns the WP Engine install primary domain.

Example

wpe.primaryDomain(id);

.isMultisite

Check if WP Engine install is a multisite environment by id.

Params

  • id {String}: The WP Engine install ID.
  • returns {Boolean}: Returns boolean true/false depending on if install is a multisite environment.

Example

wpe.isMultisite(id);

.newBackup

Creates a new WP Engine Backup by id.

Params

  • id {String}: The WP Engine install ID.
  • description {String}: Backup description.
  • notification_emails {Array}: Backup notification email addresses.
  • returns {Boolean}: Returns backup response. Example
wpe.newBackup(id, description, notification_emails);

.getWpeApi

Get custom WP Engine data.

Params

  • ...args {Any}: Api arguments. Docs: https://wpengineapi.com.
  • returns {Object}: Returns api data.

Examples

wpe.getWpeApi('installs', { limit: 10 })
	.then((res) => {
		console.log(res);
	})
	.catch((err) => console.error(`Error: ${err}`));
wpe.getWpeApi('installs', id, 'domains')
	.then((res) => {
		console.log(res);
	})
	.catch((err) => console.error(`Error: ${err}`));

.postWpeApi

Post custom WP Engine data.

Params

  • ...args {Any}: Api arguments. Docs: https://wpengineapi.com.
  • returns {Object}: Returns api response.

Examples

wpe.postWpeApi('installs', id, 'backups', {
	description,
	notification_emails,
})
	.then((res) => {
		console.log(res);
	})
	.catch((err) => console.error(`Error: ${err}`));