code: function precompile(source, options, callback) {
    if (typeof source === 'object' && typeof options === 'function') {
      callback = options;
      options = source;
      source = options.source;
    }
  
    const promise = Promise.try(() => {
      const opts = Object.assign({}, precompile.defaults, options);
  
      if (typeof source !== 'string') {
        throw Error('source must be a string');
      }
  
      // benchpress-rs doesn't support unsafe yet
      const compiled = (opts.unsafe || opts.native === false ? compileFallback : compile)(
        source,
        opts
      );
      return opts.minify ? minify(compiled) : compiled;
    });
  
    if (callback) {
      promise.then(
        code => process.nextTick(callback, null, code),
        err => process.nextTick(callback, err),
      );
    }
  
    return promise;
  }
docs: Precompile a benchpress template
  - `precompiled(source, options): Promise<string>`
  - `precompile(source, options, callback) => callback(err, output)`
  - `precompile({ source, ...options }, callback) => callback(err, output)`
  
  @param {string} source - Template source
  @param {Object} options
  @param {boolean} [options.minify = false] - Output minified code
  @param {boolean} [options.unsafe = false] - Disable safety checks, will throw on misshapen data
  @param {boolean} [options.native = true] - Use the native Rust compiler if available
  @param {function} [callback] - (err, output)
  @returns {Promise<string>} - output code