import macFromIp from 'macfromip' ; export default ( ip ) => new Promise < string > ( ( resolve , reject ) => { macFromIp . getMac ( ip , ( err , data ) => { if ( err ) { reject ( err ) ; return ; } const mac = data . trim ( ) . split ( ':' ) . map ( n => n . length < 2 ? `0${ n }` : `${ n }` ) . join ( ':' ) ; resolve ( mac ) ; } ) ; } ) ;