API Reference

Hexo Class

Defined in lib/core/index.js:17
Extends EventEmitter

Description

All Hexo methods and functions are defined inside of this namespace.

Constructor

Hexo

All Hexo methods and functions are defined inside of this namespace.

Methods

bootstrap

(baseDir, args) chainable

Bootstraps Hexo environment.

Parameters

call

(name, [args], [callback]) chainableasync

Calls a console plugin.

Parameters

constant

(name, value) chainable

Defines a constant.

Parameters

Properties

base_dir

final

The path of base directory, equals to the current working directory (CWD).

config

Configuration.

core_dir

final

The path of core directory of Hexo.

env

final

Environment variables.

This object contains the following attributes:

  • debug: Determines whether debug mode is on.
  • safe: Determines whether safe mode is on.
  • silent: Determines whether silent mode is on.
  • env: Node.js environment variable. Default to development.
  • version: Hexo version number.
  • init: Determines whether Hexo has been initalized.

extend

The extend instance.

lib_dir

final

The path of library directory of Hexo.

model

The model instance.

plugin_dir

The path of plugin directory.

post

See post.

public_dir

The path of public directory.

scaffold_dir

The path of scaffold directory.

script_dir

The path of script directory.

source_dir

The path of source directory.

theme_dir

The path of theme directory.

theme_script_dir

The path of theme script directory.

util

See util.

version

final

Hexo version number.

Events

deployAfter

(err)

Fired after deployment.

Parameters

deployBefore

Fired before deployment.

exit

Defined in lib/init.js:67

Fired when Hexo is about to exit.

new

(path, content)

Fired when a new post created.

Parameters

  • path String

    The full path of the new post

  • content String

    The content of the new post

processAfter

(base)

Fired after the process has been done.

Parameters

  • base String

    The base path of the box

processBefore

(base)

Fired before the process started.

Parameters

  • base String

    The base path of the box

ready

Defined in lib/init.js:39

Fired when Hexo is ready.

server

Fired after server started.