add `shutdown` event
add `error` event
add log()
add option `extract`, `dist`
update examples