1.0.3 • Published 3 years ago

wpinstaller v1.0.3

Weekly downloads
16
License
MIT
Repository
github
Last release
3 years ago

WPinstaller

WPinstaller is a Node.js CLI module that let you install easily WordPress CMS sites on your local PHP dev environment such as XAMPP, Wamp or MAMP

Installation

You can install this module globally or locally

Install globally

$ npm install -g wpinstaller

Install locally

$ npm install --save wpinstaller

Usage

globally

Enter to your htdocs folder

$ cd htdocs

Create and enter to your site directory

NOTE: A dir must be provided

$ mkdir my-wp-site && cd my-wp-site

Open your terminal and run wpinstaller command

$ wpinstaller

Or with npx

$ npx wpinstaller

Once you will run the wpinstaller command, a prompt configuration will be displayed in the terminal

Prompt config questions

InputDescriptionDefault
Site languageThe language that the site will be displayedEN
DatabaseThe name of the database you want to use with WordPress. Database name is required! - If the database does not exist in your Database Service ( MySQL or MariaDB ) it will created automatically for you according to the Database name you will supply
UserYour database username such as rootroot
User passwordYour database password, no password required for root
PortWikipedia8080
HostYou should be able to get this info from your web hostlocalhost
PrefixIf you want to run multiple WordPress installations in a single databasewp_
Site titleYour WordPress site titleSimple site title
Admin usernameThe username will be used for log in after the installationadmin
Admin passwordThe site admin password123456
Admin emailThe site admin email addressadmin@wp.com

After a successful installation you will be able to access your site at:

e.g http://localhost:8080/my-wp-site

locally

const path = require('path');
const wpinstaller = require('wpinstaller');
const site_name = 'my-wp-site';
const site_directory = path.resolve( process.cwd(), site_name );

wpinstaller( site_directory )
  .then( status => {
    console.log( status );
    process.exit(0);
  })
  .catch( err => {
    console.error( err );
    process.exit(1);
  });

License

MIT