API Reference

util Class

Defined in lib/util/index.js:1

Description

Utilities.

Methods

exec

(options) static
Defined in lib/util/exec.js:3

Runs a command in a shell and buffers the output.

Parameters

highlight

(str, [options]) String static

Highlights a code block.

See highlight.js

Parameters

Returns

html_tag

(tag, attrs, [text]) String static

Creates a snippet of HTML tag.

Examples:

html_tag('a', {href: 'http://www.google.com'}, 'Google');
html_tag('img', {src: 'foo.jpg'});

yields:

<a href="http://www.google.com">Google</a>
<img src="foo.jpg">

Parameters

Returns

spawn

(options)
Defined in lib/util/spawn.js:3

Launches a new process.

Parameters

titlecase

(str) String

See util.inflector/titleize.

Parameters

Returns

Properties

file

Deprecated: Use hexo.util.file2 or hexo.file instead.

See util.file