import validateProjectName from 'validate-npm-package-name' ; export function validateNpmName ( name ) { const nameValidation = validateProjectName ( name ) ; if ( nameValidation . validForNewPackages ) { return { valid : true } ; } return { valid : false , problems : [ ... ( nameValidation . errors || [ ] ) , ... ( nameValidation . warnings || [ ] ) , ] , } ; }