repo_description: Deploy Node.js projects to AWS Lambda and API Gateway easily
repo_topics: api-gateway aws aws-lambda claudia javascript nodejs serverless
code: const fs = require('fs'),
  	gunzip = require('gunzip-maybe'),
  	tarStream = require('tar-fs');
  
  module.exports = function extractTar(archive, dir) {
  	'use strict';
  	return new Promise((resolve, reject) => {
  		const extractStream = tarStream.extract(dir);
  		extractStream.on('finish', () => resolve(dir));
  		extractStream.on('error', reject);
  		fs.createReadStream(archive).pipe(gunzip()).pipe(extractStream);
  	});
  };
  