fileoverview author Artem Yavorsky
  import * as resolve from 'resolve' ; import * as semver from 'semver' ; export function detectVersion ( packageName ) { try { const pkgPath = resolve . sync ( `${ packageName }/package.json` , { basedir : process . cwd ( ) } ) ; const pkg = require ( pkgPath ) ; return pkg . version ; } catch ( e ) { return null ; } } export function isVersionGreater ( packageName , version ) { const currentVersion = detectVersion ( packageName ) ; if ( ! currentVersion ) return false ; return semver . gt ( currentVersion , version ) ; } ;