import * as dns from 'dns' ; export const checkInternet = ( cb ) => { dns . lookup ( 'google.com' , err => { if ( err && err . code === 'ENOTFOUND' ) { cb ( false ) ; } else { cb ( true ) ; } } ) ; } ;