lib/main.js
function(languageSlug) {
       return new Promise(function(resolve, reject) {
            try{
                resolve(library.listProjectsLastModified(languageSlug));
            } catch (err) {
                reject(err);
            }
        }).then(function(projects) {
            return listResourceContainers()
                .then(function(results) {
                    // flatten modified_at
                    let local = {};
                    for(let info of results) {
                        try {
                            if(languageSlug && info.language.slug !== languageSlug) continue;
                            if(!local[info.project.slug]) local[info.project.slug] = -1;
                            let old = local[info.project.slug];
                            local[info.project.slug] = info.modified_at > old ? info.modified_at : old;
                        } catch (err) {
                            console.error(err);
                        }
                    }
                    return inferUpdates(local, projects);
                });
        });
    }
function(languageSlug) {
       return new Promise(function(resolve, reject) {
            try{
                resolve(library.listProjectsLastModified(languageSlug));
            } catch (err) {
                reject(err);
            }
        }).then(function(projects) {
            return listResourceContainers()
                .then(function(results) {
                    // flatten modified_at
                    let local = {};
                    for(let info of results) {
                        try {
                            if(languageSlug && info.language.slug !== languageSlug) continue;
                            if(!local[info.project.slug]) local[info.project.slug] = -1;
                            let old = local[info.project.slug];
                            local[info.project.slug] = info.modified_at > old ? info.modified_at : old;
                        } catch (err) {
                            console.error(err);
                        }
                    }
                    return inferUpdates(local, projects);
                });
        });
    }
function ( languageSlug ) { return new Promise ( function ( resolve , reject ) { try { resolve ( library . listProjectsLastModified ( languageSlug ) ) ; } catch ( err ) { reject ( err ) ; } } ) . then ( function ( projects ) { return listResourceContainers ( ) . then ( function ( results ) { // flatten modified_at let local = { } ; for ( let info of results ) { try { if ( languageSlug && info . language . slug !== languageSlug ) continue ; if ( ! local [ info . project . slug ] ) local [ info . project . slug ] = - 1 ; let old = local [ info . project . slug ] ; local [ info . project . slug ] = info . modified_at > old ? info . modified_at : old ; } catch ( err ) { console . error ( err ) ; } } return inferUpdates ( local , projects ) ; } ) ; } ) ; }
Returns a list of projects that are eligible for updates.
If no language is given the results will include all projects in all languages. This is helpful if you need to view updates based on project first rather than source language first.

@param languageSlug {string|null} the slug of a source language who's projects will be checked.
@returns {Promise.<Array>} An array of slugs
Returns a list of projects that are eligible for updates . If no language is given the results will include all projects in all languages . This is helpful if you need to view updates based on project first rather than source language first .