code: function example (filename, options) {
    return fs.readFile(filename, 'utf-8')
      .then(function (contents) {
        // Relative path to the current module (e.g. "../"). This path must be replaced
        // by the module name in the
        const modulePath = path.relative(path.dirname(filename), '.')
        debug('example modulepath', modulePath)
        const requireModuleRegex = new RegExp(regex`require\('${modulePath}/?(.*?)'\)`, 'g')
        if (options && options.hash && options.hash.snippet) {
          contents = contents.match(/---<snip>---.*\n([\S\s]*?)\n.*---<\/snip>---/)[1]
        }
  
        return util.format('```%s\n%s\n```',
          path.extname(filename).substr(1),
          contents.trim().replace(requireModuleRegex, function (match, suffix) {
            return `require('${require(process.cwd() + '/package').name}${suffix ? '/' + suffix : ''}')`
          })
        )
      })
  }
docs: Includes an example file into the template, replacing `require()` calls to the current
  module by `require('module-name')` (only single-quotes are replaced)
  
  If your file is `examples/example.js`, you would do
  ```js
  var fn = require('../')
  ```
  to load your module. That way, you get an executable script.
  The helper will when include
  ```js
  var fn = require('module-name')
  ```
  in your docs, which is what a user of the module will do.
  
  @param {string} filename the name of the example file
  @param {object} options.hash
  @param {boolean} options.hash.snippet If set to true, only the lines between
  &lt;snip> and &lt;/snip> will be included
  @access public
  @memberOf helpers