lib/plugins/aws/invokeLocal/index.js/AwsInvokeLocal/extractArtifact
class AwsInvokeLocal:  extractArtifact() {
    const artifact = _.get(this.options.functionObj, 'package.artifact', _.get(
      this.serverless.service, 'package.artifact'
    ));
    if (!artifact) {
      return this.serverless.config.servicePath;
    }
    return fs.readFileAsync(artifact)
      .then(jszip.loadAsync)
      .then(zip => BbPromise.all(
        Object.keys(zip.files)
          .map(filename => zip.files[filename].async('nodebuffer').then(fileData => {
            if (filename.endsWith(path.sep)) {
              return BbPromise.resolve();
            }
            mkdirp.sync(path.join(
              '.serverless', 'invokeLocal', 'artifact', path.dirname(filename)));
            return fs.writeFileAsync(path.join(
              '.serverless', 'invokeLocal', 'artifact', filename), fileData, {
                mode: zip.files[filename].unixPermissions,
              });
          }))))
      .then(() => path.join(
        this.serverless.config.servicePath, '.serverless', 'invokeLocal', 'artifact'));
  }