wp-config

1.0.0 • Public • Published

wp-config

Configure your WordPress with the NodeJS

Installation

> npm install https://github.com/dkfiresky-wp/wp-config.git

Usage

 
const wpconfig = require( 'wp-config' );
 
let config = {
        'DB_NAME': 'wordpress',
        'DB_USER': 'root',
        'DB_PASSWORD': '',
        'DB_HOST': 'localhost',
        'DB_CHARSET': 'utf8',
        'DB_COLLATE': '',
        'TABLE_PREFIX': 'wp_',
        'WP_DEBUG': false,
        'WP_DEBUG_LOG': false,
        'WP_DEBUG_DISPLAY': false,
        'SCRIPT_DEBUG': false,
        'CONCATENATE_SCRIPTS': false,
        'SCRIPT_DEBUG': false,
        'WP_CACHE': false
    },
    backup = true;
 
wpconfig( '/home/wp/www/wp-config.php', config, ( error ) => {
  if ( null !== error) throw error;
  console.log( 'WordPress configuration completed!' );
}, backup );
 

In the example bellow actual keys are replaced with the ... sign.

Generated configuration file example:

<?php
/**
 * This configuration file generated by wp-config!
 *
 * @link https://github.com/dkfiresky/wp-config#readme
 */
define'DB_NAME''wordpress' );
define'DB_USER''root' );
define'DB_PASSWORD''' );
define'DB_HOST''localhost' );
define'DB_CHARSET''utf8' );
define'DB_COLLATE''' );
$table_prefix = 'wp_';
define'WP_DEBUG'false );
define'WP_DEBUG_LOG'false );
define'WP_DEBUG_DISPLAY'false );
define'SCRIPT_DEBUG'false );
define'CONCATENATE_SCRIPTS'false );
define'WP_CACHE'false );
define('AUTH_KEY',         '...');
define('SECURE_AUTH_KEY',  '...');
define('LOGGED_IN_KEY',    '...');
define('NONCE_KEY',        '...');
define('AUTH_SALT',        '...');
define('SECURE_AUTH_SALT''...');
define('LOGGED_IN_SALT',   '...');
define('NONCE_SALT',       '...');
 
if ( !defined('ABSPATH') ) define('ABSPATH'dirname(__FILE__. '/');
require_once(ABSPATH . 'wp-settings.php');

The authentication unique keys are automatically generated by WordPress.org secret-key service

Readme

Keywords

none

Package Sidebar

Install

npm i wp-config

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • dkfiresky