import glob from 'glob' ; import * as path from 'path' ; import { uniq } from './util' ; /**
 * Globber interface.
 */ export interface IGlobber { param pattern globPackageFiles ( pattern ) : Promise < Array < string > > ; } /**
 * Creates a globber.
 */ export function createGlobber ( ) { return { globPackageFiles ( pattern ) { return new Promise < Array < string > > ( ( resolve , reject ) => glob ( path . join ( pattern , 'package.json' ) , { ignore : '**/node_modules/**' } , ( err , matches ) => err ? reject ( err ) : resolve ( uniq ( matches ) ) ) ) ; } , } ; }