code: function usage(options) {
    var settings = {}
    var pack
    var main
    var example
    var name
    var cwd
    var header
  
    if (!options) {
      options = {}
    }
  
    cwd = options.cwd || process.cwd()
  
    try {
      pack = require(resolve(cwd, 'package.json'))
    } catch (error) {
      pack = {}
    }
  
    name = options.name || pack.name || null
  
    main = resolve(cwd, options.main || pack.main || 'index.js')
  
    example = options.example
  
    if (example) {
      example = require.resolve(resolve(cwd, example))
    } else {
      EXAMPLES.some(some)
    }
  
    settings.cwd = cwd
    settings.name = name
    settings.main = main
    settings.example = example
  
    header = toExpression(options.heading || DEFAULT_HEADING)
  
    return transform
  
    function transform(tree) {
      heading(tree, header, runFactory(settings))
    }
  
    function some(filepath) {
      filepath = resolve(cwd, filepath)
  
      if (exists(filepath)) {
        example = require.resolve(filepath)
        return true
      }
  
      return false
    }
  }
docs: /* Update the example section.