const koe = require('./lib/koe')

const config = {
  exclude: ['aaa']
}

function middleware (site) {
  site.test = 'a'
}

async function run () {
  const site = await koe().configure(config)
  site.use(middleware)
  return site.build()
}

run().then(res => {
  console.log(res.test)
})

@@ -18,59 +18,259 @@
 re('
-./lib/koe')%0A%0Aconst config = %7B%0A  exclude: %5B'aaa'%5D%0A%7D%0A
+koe')%0Aconst path = require('path')%0A%0A// define a sample config that overrides/extends some default keys%0Aconst config = %7B%0A  destination: path.join(__dirname, 'dest'),%0A  exclude: %5B%0A    'npm-debug.log',%0A    'yarn.lock'%0A  %5D%0A%7D%0A%0A// define a sample middleware
 %0Afun
@@ -306,22 +306,96 @@
 ite.
-test
+log('hey!')%0A  site.foo
  = '
-a
+bar
 '%0A%7D%0A%0A
+// the main execution thread. should return a promise%0A
 asyn
@@ -433,28 +433,10 @@
 e = 
-await koe().configur
+ko
 e(co
@@ -493,51 +493,137 @@
 %0A%7D%0A%0A
-run().then(res =%3E %7B%0A  console.log(res.test)
+// execute the build process and log results%0Arun().then(res =%3E %7B%0A  console.log(res)%0A%7D).catch(err =%3E %7B%0A  // optionally, log errors
 %0A%7D)%0A

rewrite example