@eankeen/

hexo-blog

Nodejs

No description

fork
loading
Files
  • index.js
  • scaffolds
  • source
  • themes
  • db.json
  • package-lock.json
  • package.json
  • yarn.lock
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Start Hexo Development Server
let spawn = require('child_process').spawn;

let run = (cmd, args) => {
  child = spawn(cmd, args);

  child.stdout.on('data', data => process.stdout.write(data.toString()));
  child.on('close', code => console.log(`Child process exited with code ${code}.`));
};

// Start the development server
run('./node_modules/.bin/hexo', ['server'])

// Create a new post called "Bar"
// ./_node_modules/.bin/hexo new post "Bar"
// run('./node_modules/.bin/hexo', ['new', 'post', `"Bar"`]);



node v10.16.0