<commit_before>import Promise from 'bluebird';
import request from 'superagent-bluebird-promise';

const apmApi = process.env.ATOM_API_URL || 'https://atom.io/api';

export default function fetch(port, config, path, modules) {
    let nodeModules = Promise.all(modules.map(module => (
        request.get(`${apmApi}/packages/${module}`).promise()
    ))).reduce(dependencies, extension => {
        extension = JSON.parse(extension.text);
        let pkg = extension.versions[extension.releases.latest];
        let deps = pkg.dependencies;
        return [...dependencies, ...Object.keys(deps).map(dep => (`${dep}@${deps[dep]}`))];
    }, []);
}<commit_msg>now returns an object of the tgz dist<commit_after>import Promise from 'bluebird';
import request from 'superagent-bluebird-promise';

const apmApi = process.env.ATOM_API_URL || 'https://atom.io/api';

export default function fetch(port, config, path, modules) {
    let { dependencies, extensions } = Promise.all(modules.map(module => (
        request.get(`${apmApi}/packages/${module}`).promise()
    ))).reduce(({ dependencies, extensions }, extension) => {
        extension = JSON.parse(extension.text);
        let pkg = extension.versions[extension.releases.latest];
        let deps = pkg.dependencies;
        return {
            dependencies: [...dependencies, ...Object.keys(deps).map(dep => (`${dep}@${deps[dep]}`))],
            extensions: {
                [`${pkg.name}@${pkg.version}`]: pkg.dist.tarball
            }
        }
    }, {
        dependencies: [],
        extensions: {}
    }).then(({ dependencies, extensions }) => {
    });
}
{'fraction_non_alphanumeric': 0.17469135802469135, 'fraction_numerical': 0.0, 'mean_word_length': 3.1564102564102563, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '71148', 'n_tokens_mistral': 484, 'n_tokens_neox': 472, 'n_words': 93}