const weh = require('./index2')

const plugin = ({ value = 'hi' }) => {
  return ['pre_write', files => {
    return files.map(file => Object.assign(file, { contents: value }))
  }]
}

const hook = files => files.map(file => Object.assign(file, { contents: 'a' }))

weh(async site => {
  site.config({ source: '_test' })
  site.hook('pre_read', hook)
  return site
}).then(cool => {
  console.log(cool)
})

@@ -182,89 +182,8 @@
 %0A%7D%0A%0A
-const hook = files =%3E files.map(file =%3E Object.assign(file, %7B contents: 'a' %7D))%0A%0A
 weh(
@@ -244,29 +244,18 @@
 ite.
-hook('pre_read', hook
+use(plugin
 )%0A  
@@ -284,16 +284,16 @@
 ol =%3E %7B%0A
-
   consol
@@ -302,13 +302,19 @@
 log(cool
+.files
 )%0A%7D)%0A

update example for plugin stuff