import spawn from 'cross-spawn' ; export default ( projectName ) : Promise < { latest : string ; [ tag ] : string ; } > => { return new Promise ( ( resolve ) => { const pkgInfoStr = spawn . sync ( 'npm' , [ 'info' , projectName , '--json' ] ) . stdout . toString ( ) ; const pkgInfo = JSON . parse ( pkgInfoStr ) ; resolve ( pkgInfo [ 'dist-tags' ] ) ; } ) ; } ;