function asPromise(component, options) {
  if (!component) {
    throw new Error('No component or graph provided');
  }
  options = normalizeOptions(options, component);
  return (inputs) => prepareNetwork(component, options)
    .then((network) => {
      if (options.networkCallback) {
        options.networkCallback(network);
      }
      const resultType = getType(inputs, network);
      const inputMap = prepareInputMap(inputs, resultType, network);
      return runNetwork(network, inputMap)
        .then((outputMap) => sendOutputMap(outputMap, resultType, options));
    });
}
@param {Graph | string} component - Graph or component to load
@param {Object} options
@param {string} [options.name] - Name for the wrapped network
@param {ComponentLoader} [options.loader] - Component loader instance to use, if any
@param {string} [options.baseDir] - Project base directory for component loading
@param {Object} [options.flowtrace] - Flowtrace instance to use for tracing this network run
@param {NetworkCallback} [options.networkCallback] - Access to Network instance
@param {boolean} [options.raw] - Whether the callback should operate on raw noflo.IP objects
@returns {NetworkAsPromise}