我npm info
用来获取我们自己的私有工件的现有版本列表,这些工件位于一个nexus 3 npm存储库中。对于新功能,我们使用预发行版本。
以下是我的完整数据集,列出了当前存在的所有版本:
[
'1.7.0',
'1.7.1',
'1.7.2',
'1.7.3',
'1.7.4',
'1.7.5',
'1.7.6',
'1.7.7',
'1.7.8',
'1.7.9',
'1.7.10',
'1.7.11',
'1.7.12',
'1.7.13',
'1.7.14',
'1.7.15',
'1.7.16',
'1.7.17',
'1.7.18',
'1.7.19',
'1.7.20',
'1.7.21',
'1.7.22',
'1.7.23',
'1.7.24',
'1.7.25',
'1.7.26',
'1.7.27',
'1.7.28',
'1.7.29',
'1.7.30',
'1.7.31',
'1.7.32',
'1.7.33',
'1.7.34',
'1.7.35',
'1.7.36',
'1.7.37',
'1.7.38',
'1.7.39',
'1.7.40',
'1.7.41',
'1.7.42',
'1.7.43',
'1.7.44',
'1.7.45',
'1.7.46',
'1.7.47',
'1.7.48',
'1.7.49',
'1.7.50',
'1.7.51',
'1.7.52',
'1.7.53',
'1.7.54',
'1.7.55',
'1.7.56',
'1.7.57',
'1.7.58',
'1.7.59',
'1.7.60',
'1.7.61',
'1.7.62',
'1.7.63',
'1.7.64',
'1.7.65',
'1.7.66',
'1.7.67',
'1.7.68',
'1.7.69',
'1.7.70',
'1.7.71',
'1.7.72',
'1.7.73',
'1.7.74',
'1.7.75',
'1.7.76',
'1.7.77',
'1.7.78',
'1.7.79',
'1.7.80',
'1.7.81',
'1.7.82',
'1.7.83',
'1.7.84',
'1.7.85',
'1.7.86',
'1.7.87',
'1.7.88',
'1.7.89',
'1.7.90',
'1.7.91',
'1.7.92',
'1.7.93',
'1.7.94',
'1.7.95',
'1.7.96',
'1.7.97',
'1.7.98',
'1.7.99',
'1.7.100',
'1.7.101',
'1.7.102',
'1.7.103',
'1.7.104',
'1.7.105',
'1.7.106',
'1.7.107',
'1.7.108',
'1.7.109',
'1.7.110',
'1.7.111',
'1.7.112',
'1.7.113',
'1.7.114',
'1.7.115',
'1.7.116',
'1.7.117',
'1.7.118',
'1.7.119',
'1.7.120',
'1.7.121',
'1.7.122',
'1.7.123',
'1.7.124',
'1.7.125',
'1.7.126',
'1.7.127',
'1.7.128',
'1.7.129',
'1.7.130',
'1.7.131',
'1.7.132',
'1.7.133',
'1.7.134',
'1.7.135',
'1.7.136',
'1.7.137',
'1.7.138',
'1.7.139',
'1.7.140',
'1.7.141',
'1.7.142',
'1.7.143',
'1.7.144',
'1.7.145',
'1.7.146',
'1.7.147',
'1.7.148',
'1.7.149',
'1.7.150',
'1.7.151',
'1.7.152',
'1.7.153',
'1.7.154',
'1.7.155',
'1.7.156',
'1.7.157',
'1.7.158',
'1.7.159',
'1.11.0',
'1.12.0',
'1.12.1',
'1.12.2',
'1.12.3',
'1.12.4',
'1.12.5',
'1.12.6',
'1.12.7',
'1.12.8',
'1.12.9',
'1.12.10',
'1.12.11',
'1.12.12',
'1.12.13',
'1.12.14',
'1.12.15',
'1.12.16',
'1.12.17',
'1.12.18',
'1.12.19',
'1.12.20',
'1.12.21',
'1.12.22',
'1.12.23',
'1.12.24',
'1.12.25',
'1.12.26',
'1.12.27',
'1.12.28',
'1.12.29',
'1.12.30',
'1.12.31',
'1.12.32',
'1.12.33',
'1.12.34',
'1.12.35',
'1.12.36',
'1.13.0-4161.0',
'1.13.0-4161.1',
'1.13.0-4161.2',
'1.13.0-ft.0',
'1.13.0-ft.1',
'1.13.0-ft.2',
'1.13.0-ft.3',
'1.13.0-ft.4',
'1.13.0-ft.5',
'1.13.0-ft.6',
'1.13.0-ft.7',
'1.13.0-ft.8',
'1.13.0-ft.9',
'1.13.0-ft.10',
'1.13.0-ft.11',
'1.13.0-ft.12',
'1.13.0-ft.13',
'1.13.0-ft.14',
'1.13.0-ft.15',
'1.13.0-ft.16',
'1.13.0-ft.17',
'1.13.0-ft.18',
'1.13.0-ft.19',
'1.13.0-ft.20',
'1.13.0-ft.21',
'1.13.0-ft.22',
'1.13.0-ft.23',
'1.13.0-ft.24',
'1.13.0-ft.25',
'1.13.0-ft.26',
'1.13.0-ft.27',
'1.13.0-ft.28',
'1.13.0-ft.29',
'1.13.0-ft.30',
'1.13.0-ft.31',
'1.13.0-ft.32',
'1.13.0-ft.33',
'1.13.0-ft.34',
'1.13.0-ft.35',
'1.13.0-ft.36',
'1.13.0-ft.37',
'1.13.0-ft.38',
'1.13.0-ft.39',
'1.13.0-ft.40',
'1.13.0-ft.41',
'1.13.0-ft-on-angular.0',
'1.13.0-ft-on-angular.1',
'1.13.0-ft-on-angular.2',
'1.13.0-ft-on-angular.3',
'1.13.0-ft-on-angular.4',
'1.13.0-ft-on-angular.5',
'1.13.0-ft-on-angular.6',
'1.13.0-ft-on-angular.7',
'1.13.0-ft-on-angular.8',
'1.13.0-ft-on-angular.9',
'1.13.0-ft-on-angular.10',
'1.13.0-perf.0',
'1.13.0-perf.1',
'1.13.0-perf.2',
'1.13.0-perf.3',
'1.13.0-perf.4',
'1.13.0-perf.5',
'1.13.0-perf.6',
'1.13.0-perf.7',
'1.13.0-revival.0',
'1.13.0-revival.1',
'1.13.0-revival.2',
'1.13.0-revival.3',
'1.13.0-revival.4',
'1.13.0-revival.5',
'1.13.0-revival.6',
'1.13.0-revival.7',
'1.13.0-revival.8',
'1.13.0-revival.9',
'1.13.0-revival.10',
'1.13.0-revival.11',
'1.13.0-revival.12',
'1.13.0-revival.13',
'1.13.0-revival.14',
'1.13.0-revival.15',
'1.13.0-revival2.0',
'1.13.0-revival2.1',
'1.13.0-user-pdf.0',
'1.13.0-user-pdf.1',
'1.13.0-user-pdf.2',
'1.13.0-user-pdf.3',
'1.13.0-user-pdf.4',
'1.13.0-user-pdf.5',
'1.13.0-user-pdf.6',
'1.13.0-user-pdf.7',
'1.13.0-user-pdf.8',
'1.13.0-user-pdf.9',
'1.13.0-user-pdf.10',
'1.13.0-user-pdf.11',
'1.13.0-user-pdf.12',
'1.13.0-user-pdf.13',
'1.13.0-user-pdf.14',
'1.13.0-user-pdf.15',
'1.13.0-user-pdf.16',
'1.13.0-user-pdf.17',
'1.13.0-user-pdf.18',
'1.13.0',
'1.13.1',
'1.13.2',
'1.13.3',
'1.13.4',
'1.13.5',
'1.13.6',
'1.13.7',
'1.13.8',
'1.13.9',
'1.13.10',
'1.13.11',
'1.13.12',
'1.13.13',
'1.13.14',
'1.13.15',
'1.13.16',
'1.13.17',
'1.13.18',
'1.13.19',
'1.13.20',
'1.13.21',
'1.13.22',
'1.13.23',
'1.13.24',
'1.13.25',
'1.13.26',
'1.13.27',
'1.13.28',
'1.13.29',
'1.13.30',
'1.13.31',
'1.13.32',
'1.13.33',
'1.13.34',
'1.13.35',
'1.13.36',
'1.13.37',
'1.13.38',
'1.13.39',
'1.13.40',
'1.13.41',
'1.13.42',
'1.13.43',
'1.13.44',
'1.13.45',
'1.13.46',
'1.13.47',
'1.13.48',
'1.13.49',
'1.13.50',
'1.13.51',
'1.13.52',
'1.13.53',
'1.13.54',
'1.13.55',
'1.13.56',
'1.13.57',
'1.13.58',
'1.13.59',
'1.13.60',
'1.13.61',
'1.13.62',
'1.13.63',
'1.13.64',
'1.13.65',
'1.13.66',
'1.13.67',
'1.13.68',
'1.13.69',
'1.13.70',
'1.13.71',
'1.13.72',
'1.13.73',
'1.13.74',
'1.13.75',
'1.13.76',
'1.13.77',
'1.13.78',
'1.13.79',
'1.13.80',
'1.13.81',
'1.13.82',
'1.13.83',
'1.13.84',
'1.13.85',
'1.13.86',
'1.13.87',
'1.13.88',
'1.13.89',
'1.13.90',
'1.13.91',
'1.13.92',
'1.13.93',
'1.13.94',
'1.13.95',
'1.13.96',
'1.13.97',
'1.13.98',
'1.13.99',
'1.13.100',
'1.13.101',
'1.13.102',
'1.13.103',
'1.13.104',
'1.13.105',
'1.13.106',
'1.13.107',
'1.13.108',
'1.13.109',
'1.13.110',
'1.13.111',
'1.13.112',
'1.13.113',
'1.13.114',
'1.13.115',
'1.13.116',
'1.13.117',
'1.13.118',
'1.13.119',
'1.13.120',
'1.13.121',
'1.13.122',
'1.13.123',
'1.13.124',
'1.13.125',
'1.13.126',
'1.13.127',
'1.13.128',
'1.13.129',
'1.13.130',
'1.13.131',
'1.13.132',
'1.13.133',
'1.13.134',
'1.13.135',
'1.13.136',
'1.13.137',
'1.13.138',
'1.13.139',
'1.13.140',
'1.13.141',
'1.13.142',
'1.13.143',
'1.13.144',
'1.13.145',
'1.13.146',
'1.13.147',
'1.13.148',
'1.13.149',
'1.13.150',
'1.13.151',
'1.13.152',
'1.13.153',
'1.13.154',
'1.13.155',
'1.13.156',
'1.13.157',
'1.13.158',
'1.13.159',
'1.13.160',
'1.13.161',
'1.13.162',
'1.13.163',
'1.13.164',
'1.13.165',
'1.13.166',
'1.13.167',
'1.13.168',
'1.13.169',
'1.13.170',
'1.13.171',
'1.13.172',
'1.13.173',
'1.13.174',
'1.13.175',
'1.13.176',
'1.13.177',
'1.14.0-1263aaaa.0',
'1.14.0-1294trackingwithreferrer.0',
'1.14.0-7076reminder.0',
'1.14.0-7076reminder.1',
'1.14.0-7076reminder.2',
'1.14.0-7076reminder.3',
'1.14.0-7521id.0',
'1.14.0-7521id.1',
'1.14.0-7521id.2',
'1.14.0-7521id.3',
'1.14.0-7540quit.0',
'1.14.0-7540quit.1',
'1.14.0-7540quit.2',
'1.14.0-7540quit.3',
'1.14.0-7540quit.4',
'1.14.0-7676update-mail-tests.0',
'1.14.0-7676update-mail-tests.1',
'1.14.0-7676update-mail-tests.2',
'1.14.0-7807html-title.0',
'1.14.0-7807html-title.1',
'1.14.0-7807html-title.2',
'1.14.0-7807html-title.3',
'1.14.0-7807html-title.4',
'1.14.0-7807html-title.5',
'1.14.0-7852.0',
'1.14.0-7852.1',
'1.14.0-7852.2',
'1.14.0-7852.3',
'1.14.0-7874logout.0',
'1.14.0-7874logout.1',
'1.14.0-7874logout.2',
'1.14.0-7874logout.3',
'1.14.0-7874logout.4',
'1.14.0-7874logout.5',
'1.14.0-8002price.0',
'1.14.0-8002price.1',
'1.14.0-8079tipp.0',
'1.14.0-8079tipp.1',
'1.14.0-8079tipp.2',
'1.14.0-ft.0',
'1.14.0-ft.1',
'1.14.0-ft.2',
'1.14.0-ft.3',
'1.14.0-ft.4',
'1.14.0-ft.5',
'1.14.0-ft.6',
'1.14.0-ft.7',
'1.14.0-ft.8',
'1.14.0-ft.9',
'1.14.0-ft.10',
'1.14.0-ft.11',
'1.14.0-ft.12',
'1.14.0-ft.13',
'1.14.0-ft.14',
'1.14.0-ft.15',
'1.14.0-ft.16',
'1.14.0-ft.17',
'1.14.0-ft.18',
'1.14.0-ft.19',
'1.14.0-ft.20',
'1.14.0-ft.21',
'1.14.0-ft.22',
'1.14.0-ft.23',
'1.14.0-ft.24',
'1.14.0-ft.25',
'1.14.0-ft.26',
'1.14.0-ft.27',
'1.14.0-ft.28',
'1.14.0-ft.29',
'1.14.0-ft.30',
'1.14.0-ft.31',
'1.14.0-ft.32',
'1.14.0-ft.33',
'1.14.0-ft.34',
'1.14.0-ft.35',
'1.14.0-ft.36',
'1.14.0-ft.37',
'1.14.0-ft.38',
'1.14.0-ft.39',
'1.14.0-ft.40',
'1.14.0-ft.41',
'1.14.0-ft.42',
'1.14.0-ft.43',
'1.14.0-ft.44',
'1.14.0-ft.45',
'1.14.0-ft.46',
'1.14.0-ft.47',
'1.14.0-ft.48',
'1.14.0-ft.49',
'1.14.0-ft.50',
'1.14.0-ft.51',
'1.14.0-ft.52',
'1.14.0-ft.53',
'1.14.0-ft.54',
'1.14.0-ft.55',
'1.14.0-ft.56',
'1.14.0-ft.57',
'1.14.0-ft.58',
'1.14.0-ft.59',
'1.14.0-ft.60',
'1.14.0-ft.61',
'1.14.0-ft.62',
'1.14.0-ft.63',
'1.14.0-ft.64',
'1.14.0-ft.65',
'1.14.0-ft.66',
'1.14.0-ft.67',
'1.14.0-ft.68',
'1.14.0-ft.69',
'1.14.0-ft.70',
'1.14.0-ft.71',
'1.14.0-ft.72',
'1.14.0-ft.73',
'1.14.0-ft.74',
'1.14.0-ft.75',
'1.14.0-ft.76',
'1.14.0-ft.77',
'1.14.0-ft.78',
'1.14.0-ft.79',
'1.14.0-ft.80',
'1.14.0-ft.81',
'1.14.0-ft.82',
'1.14.0-ft.83',
'1.14.0-ft.84',
'1.14.0-ft.85',
'1.14.0-ft-on-angular.0',
'1.14.0-ft-on-angular.1',
'1.14.0-ft-on-angular.2',
'1.14.0-ft-on-angular.3',
'1.14.0-ft-on-angular.4',
'1.14.0-ft-on-angular.5',
'1.14.0-ft-tracking.0',
'1.14.0-ft-tracking.1',
'1.14.0-ft-tracking.2',
'1.14.0-report-failed-deployments.0',
'1.14.0-report-failed-deployments.1',
'1.14.0-report-failed-deployments.2',
'1.14.0-report-failed-deployments.3',
'1.14.0-report-failed-deployments.4',
'1.14.0-report-failed-deployments.5',
'1.14.0-report-failed-deployments.6',
'1.14.0-tr-commons.0',
'1.14.0-tr-commons.1',
'1.14.0-tr-commons.2',
'1.14.0-tr-commons.3',
'1.14.0-tr-commons.4',
'1.14.0-tr-commons.5',
'1.14.0-tr-commons.6',
'1.14.0-tr-commons.7',
'1.14.0-tr-commons.8',
'1.14.0-tr-commons.9',
'1.14.0-tr-commons.10',
'1.14.0-tr-commons.11',
'1.14.0-tr-commons.12',
'1.14.0',
'1.14.1',
'1.14.2',
'1.14.3',
'1.14.4',
'1.14.5',
'1.14.6',
'1.14.7',
'1.14.8',
'1.14.9',
'1.14.10',
'1.14.11',
'1.14.12',
'1.14.13',
'1.14.14',
'1.14.15',
'1.14.16',
'1.14.17',
'1.14.18',
'1.14.19',
'1.14.20',
'1.14.21',
'1.14.22',
'1.14.23',
'1.14.24',
'1.14.25',
'1.14.26',
'1.14.27',
'1.14.28',
'1.14.29',
'1.14.30',
'1.14.31',
'1.14.32',
'1.14.33',
'1.14.34',
'1.14.35',
'1.14.36',
'1.14.37',
'1.14.38',
'1.14.39',
'1.14.40',
'1.14.41',
'1.14.42',
'1.14.43',
'1.14.44',
'1.14.45',
'1.14.46',
'1.14.47',
'1.14.48',
'1.14.49',
'1.14.50',
'1.14.51',
'1.14.52',
'1.14.53',
'1.14.54',
'1.14.55',
'1.14.56',
'1.14.57',
'1.14.58',
'1.14.59',
'1.14.60',
'1.14.61',
'1.14.62',
'1.14.63',
'1.14.64',
'1.14.65',
'1.14.66',
'1.14.67',
'1.14.68',
'1.14.69',
'1.14.70',
'1.14.71',
'1.14.72',
'1.14.73',
'1.14.74',
'1.14.75',
'1.14.76',
'1.14.77',
'1.14.78',
'1.14.79',
'1.14.80',
'1.14.81',
'1.14.82',
'1.14.83',
'1.14.84',
'1.14.85',
'1.14.86',
'1.14.87',
'2.2.0',
'2.2.1',
'2.2.2',
'2.2.3',
'2.2.4',
'2.2.5',
'2.2.6',
'2.2.7',
'2.2.8',
'2.2.9',
'2.2.10',
'2.2.11',
'2.2.12',
'2.2.13',
'2.2.14',
'2.2.15',
'2.2.16',
'2.2.17',
'2.2.18',
'2.2.19',
'2.2.20',
'2.2.21',
'2.2.22',
'2.2.23',
'2.2.24',
'2.2.25',
'2.2.26',
'2.2.27',
'2.2.28',
'2.2.29',
'2.2.30',
'2.2.31',
'2.2.32',
'2.2.33',
'2.2.34',
'2.2.35',
'2.2.36',
'2.2.37',
'2.2.38',
'2.2.39',
'2.2.40',
'2.2.41',
'2.2.42',
'2.2.43',
'2.2.44',
'2.2.45',
'2.2.46',
'2.2.47',
'2.2.48',
'2.2.49',
'2.2.50',
'2.2.51',
'2.2.52',
'2.2.53',
'2.2.54',
'2.2.55',
'2.2.56',
'2.2.57',
'2.2.58',
'2.2.59',
'2.2.60',
'2.2.61',
'2.2.62',
'2.2.63',
'2.2.64',
'2.2.65',
'2.2.66',
'2.2.67',
'2.2.68',
'2.2.69',
'2.2.70',
'2.2.71',
'2.2.72',
'2.2.73',
'2.3.0',
'2.3.1',
'2.3.2',
'2.3.3',
'2.3.4',
'2.3.5',
'2.3.6',
'2.3.7',
'2.3.8',
'2.3.9',
'2.3.10',
'2.3.11',
'2.3.12',
'2.3.13',
'2.3.14',
'2.3.15',
'2.3.16',
'2.3.17',
'2.3.18',
'2.3.19',
'2.3.20',
'2.3.21',
'2.3.22',
'2.3.23',
'2.3.24',
'2.3.25',
'2.3.26',
'2.3.27',
'2.3.28',
'2.3.29',
'2.3.30',
'2.3.31',
'2.3.32',
'2.3.33',
'2.3.34',
'2.3.35',
'2.3.36',
'2.3.37',
'2.3.38',
'2.3.39',
'2.3.40',
'2.3.41',
'2.3.42',
'2.3.43',
'2.3.44',
'2.3.45',
'2.3.46',
'2.3.47',
'2.3.48'
]
但是似乎npm在不同的预发行版本之间不会有所不同:
> npm info artifact@">=1.14.0-ft.0 <1.14.0-ft0" version
[
[email protected] '1.14.0-ft.23'
[email protected] '1.14.0-ft.24'
[email protected] '1.14.0-ft.21'
[email protected] '1.14.0-ft.22'
[email protected] '1.14.0-ft.20'
[email protected] '1.14.0-ft.29'
[email protected] '1.14.0-ft.27'
[email protected] '1.14.0-ft.28'
[email protected] '1.14.0-ft.25'
[email protected] '1.14.0-ft.26'
[email protected] '1.14.0-ft.12'
[email protected] '1.14.0-ft.13'
[email protected] '1.14.0-ft.10'
[email protected] '1.14.0-ft.11'
[email protected] '1.14.0-ft.18'
[email protected] '1.14.0-ft.19'
[email protected] '1.14.0-ft.16'
[email protected] '1.14.0-ft.17'
[email protected] '1.14.0-ft.14'
[email protected] '1.14.0-ft.15'
[email protected] '1.14.0-ft-on-angular.4'
[email protected] '1.14.0-ft.45'
[email protected] '1.14.0-ft-on-angular.5'
[email protected] '1.14.0-ft.46'
[email protected] '1.14.0-ft-on-angular.2'
[email protected] '1.14.0-ft.43'
[email protected] '1.14.0-ft-on-angular.3'
[email protected] '1.14.0-ft.44'
[email protected] '1.14.0-ft-on-angular.0'
[email protected] '1.14.0-ft.41'
[email protected] '1.14.0-ft-on-angular.1'
[email protected] '1.14.0-ft.42'
[email protected] '1.14.0-ft.40'
[email protected] '1.14.0-ft.49'
[email protected] '1.14.0-ft.47'
[email protected] '1.14.0-ft.48'
[email protected] '1.14.0-ft.34'
[email protected] '1.14.0-ft.35'
[email protected] '1.14.0-ft.32'
[email protected] '1.14.0-ft.33'
[email protected] '1.14.0-ft.30'
[email protected] '1.14.0-ft.31'
[email protected] '1.14.0-ft.38'
[email protected] '1.14.0-ft.39'
[email protected] '1.14.0-ft.36'
[email protected] '1.14.0-ft.37'
[email protected] '1.14.0-ft.67'
[email protected] '1.14.0-ft.68'
[email protected] '1.14.0-ft.65'
[email protected] '1.14.0-ft.66'
[email protected] '1.14.0-ft.63'
[email protected] '1.14.0-ft.64'
[email protected] '1.14.0-ft.61'
[email protected] '1.14.0-ft.62'
[email protected] '1.14.0-ft.69'
[email protected] '1.14.0-ft.60'
[email protected] '1.14.0-ft.56'
[email protected] '1.14.0-ft.57'
[email protected] '1.14.0-ft.54'
[email protected] '1.14.0-ft.55'
[email protected] '1.14.0-ft.52'
[email protected] '1.14.0-ft.53'
[email protected] '1.14.0-ft.50'
[email protected] '1.14.0-ft.51'
[email protected] '1.14.0-ft.58'
[email protected] '1.14.0-ft.59'
[email protected] '1.14.0-ft.83'
[email protected] '1.14.0-ft.81'
[email protected] '1.14.0-ft.82'
[email protected] '1.14.0-ft.80'
[email protected] '1.14.0-ft.78'
[email protected] '1.14.0-ft.79'
[email protected] '1.14.0-ft.76'
[email protected] '1.14.0-ft.77'
[email protected] '1.14.0-ft.74'
[email protected] '1.14.0-ft.75'
[email protected] '1.14.0-ft.72'
[email protected] '1.14.0-ft.73'
[email protected] '1.14.0-ft.70'
[email protected] '1.14.0-ft.71'
[email protected] '1.14.0-ft.4'
[email protected] '1.14.0-ft.3'
[email protected] '1.14.0-ft.2'
[email protected] '1.14.0-ft.1'
[email protected] '1.14.0-ft.0'
[email protected] '1.14.0-ft.9'
[email protected] '1.14.0-ft.8'
[email protected] '1.14.0-ft.7'
[email protected] '1.14.0-ft.6'
[email protected] '1.14.0-ft.5'
[email protected] '1.14.0-ft-tracking.0'
[email protected] '1.14.0-ft-tracking.1'
[email protected] '1.14.0-ft-tracking.2'
]
所需结果:
> npm info artifact@">=1.14.0-ft.0 <1.14.0-ft0" version
[
[email protected] '1.14.0-ft.23'
[email protected] '1.14.0-ft.24'
[email protected] '1.14.0-ft.21'
[email protected] '1.14.0-ft.22'
[email protected] '1.14.0-ft.20'
[email protected] '1.14.0-ft.29'
[email protected] '1.14.0-ft.27'
[email protected] '1.14.0-ft.28'
[email protected] '1.14.0-ft.25'
[email protected] '1.14.0-ft.26'
[email protected] '1.14.0-ft.12'
[email protected] '1.14.0-ft.13'
[email protected] '1.14.0-ft.10'
[email protected] '1.14.0-ft.11'
[email protected] '1.14.0-ft.18'
[email protected] '1.14.0-ft.19'
[email protected] '1.14.0-ft.16'
[email protected] '1.14.0-ft.17'
[email protected] '1.14.0-ft.14'
[email protected] '1.14.0-ft.15'
...
]
我不希望有任何结果,因为ft
不等于ft-on-angular
或ft-tracking
。
如何实现至少仅选择ft
预发行版本?
我已经尝试过使用类似选择器()的semver计算器,>=1.0.0-rc.0 <1.0.0-rc0
并且它仅选择1.0.0-rcX。如果我将选择器更新为>=1.0.0-r.0 <1.0.0-r0
它不匹配任何内容。
“如何实现至少选择ft作为预发行版本?”
通过npm info
命令,您将需要:
提供此比较器集以匹配-ft
该1.14.0
版本的所有预发行版:
npm info artifact @“ > = 1.14.0-ft.0 <1.14.0-ft-on-angular.0 ”版本
或者,提供此比较器集以匹配-ft
该1.13.0
版本的所有预发行版:
npm info artifact @“ > = 1.13.0-ft.0 <1.13.0-ft-on-angular.0 ”版本
或者,提供由两个比较器集组成的范围,以匹配和版本的所有-ft
预发行版:1.13.0
1.14.0
npm infoartifact @“ > = 1.13.0-ft.0 <1.13.0-ft-on-angular.0 ||> = 1.14.0-ft.0 <1.14.0-ft-on-angular.0 ”版
注意:在确定用于匹配特定预发行版本的正确比较器时,确实需要通过SemVer优先级事先了解完整的数据集及其排序顺序。使用以下npm info
命令将返回可用于给定工件/软件包的所有版本的列表(按SemVer优先级升序排列):
npm info <package_name> versions
“我不希望有任何结果,因为
ft
不等于ft-on-angular
或ft-tracking
。” 1个
为了进一步理解该npm info
命令和给定的比较器集为什么>=1.14.0-ft.0 <1.14.0-ft0
不能产生所需的存储列表,我们需要首先了解Semver规范在第11点中关于优先规则的规定。为方便起见,下面提供了第11点的副本:
注意:编号列表格式是我添加的。
优先级必须通过按以下顺序将版本分为主要,次要,补丁和预发行标识符来计算(Build元数据不优先)。
由左至右比较这些标识符中的每个标识符时,优先级由第一个差异确定,如下所示:
当主要,次要和补丁程序相等时,预发行版本的优先级低于普通版本。示例:1.0.0-alpha <1.0.0。
具有相同主要,次要和补丁版本的两个预发行版本的优先级,必须通过从左到右比较每个点分隔的标识符来确定,直到发现差异为止:
2.1。仅对由数字组成的标识符进行数字比较,然后
2.2。字母或连字符的标识符按ASCII排序顺序进行词法比较。
数字标识符的优先级始终低于非数字标识符。
如果所有前面的标识符都相等,则较大的一组预发布字段的优先级高于较小的一组。示例:1.0.0-alpha <1.0.0-alpha1 <1.0.0-alphabeta <1.0.0-beta <1.0.0-beta2 <1.0.0-beta.11 <1.0.0- rc.1 <1.0.0。
点1、2、3和4与您的OP特别相关,因为它们专门解决了关于一个semver中预发布字段/标识符的优先规则。
您使用的比较器集有什么不正确之处?
>=1.14.0-ft.0 <1.14.0-ft0
首先,我们应该注意这个比较器;<1.14.0-ft0
,要求范围小于版本,1.14.0-ft0
并且您的数据集不包含-ft0
预发布版本。
但是,如果-ft0
您的数据集中确实存在预发布标识符,则该标识符将大于现有1.14.0-ft-tracking.2
和1.14.0-ft-on-angular.0
存储的标识符,因此这就是为什么您获得的结果包括所有-ft-on-angular
和ft-tracking
预发布标识符的原因。
为了进一步说明这一点,请考虑下面的排序顺序(按升序排列)。请特别注意-ft0
预发布标识符的优先级-显然比其他标识符大。
...
'1.14.0-ft.83',
'1.14.0-ft.84',
'1.14.0-ft.85',
'1.14.0-ft-on-angular.0',
'1.14.0-ft-on-angular.1',
'1.14.0-ft-on-angular.2',
'1.14.0-ft-on-angular.3',
'1.14.0-ft-on-angular.4',
'1.14.0-ft-on-angular.5',
'1.14.0-ft-tracking.0',
'1.14.0-ft-tracking.1',
'1.14.0-ft-tracking.2',
'1.14.0-ft0', <-------
...
现在,如果您考虑上述第2、3和4点(即我在Semver规范第11点摘录中指出的那些点),那么关于优先级规则,显而易见的是为什么要对数据集中的预发布标识符进行排序这条路:
特别是,请考虑2.2点的状态;
“带有字母或连字符的[[pre-release]标识符按ASCII排序顺序按词法进行比较”。
请注意,0
结尾处的零(),1.14.0-ft0
以及ASCII排序表中的零位置(如下所示)。将其与semver中的第二个连字符(-
)1.14.0-ft-tracking.2
以及ASCII排序表中的连字符位置进行比较。如您所见,零的(0
)排序位置位于连字符(-
)之后。这解释了为什么要1.14.0-ft0
进行排序1.14.0-ft-tracking.2
。
ASCII排序顺序表:
为方便起见,以下图表显示了ASCII字符的排序顺序:
──────────┬──────────────┬ ─────┬───────┐ │空间│ - (连字符) │:│ģ│Ť│一个│ñ│}│ │!│。│; │H│U│b│o│| | │ │“│/│<│我│V│Ç│p│{│ │#│ 0 (零) │=│Ĵ│W¯¯│d│q│〜│ │$│1│>│ķ│X│电子│r│DEL││ %│2│?│L│Y│f│s│││ 和│3│@ │M│Z│g│t│││'│4│A│N│[│h│ ü││ │(│5│乙│ö│\│我│v││ │)│6│C│P│]│j│w│││ *│7│D│Q│^ │k│x│││+ │8│E│R│_│l│y││││, │9│˚F│小号│`│米│ž││ └─────────┴──────────────┴─────┴──── ──┴──────┴──────┴─────┴────────┘
您会注意到,使用以下正确npm info
命令时:
npm info artifact@">=1.14.0-ft.0 <1.14.0-ft-on-angular.0" version
它将结果打印到您的控制台,格式如下:
[email protected] '1.14.0-ft.1' [email protected] '1.14.0-ft.2' [email protected] '1.14.0-ft.3' ...
但是,如果要重新格式化结果以形成JSON数组,请考虑将输出管道传递给AWK,然后传递给node.js。例如,使用以下复合命令:
npm info artifact@">=1.14.0-ft.0 <1.14.0-ft-on-angular.0" version | awk -F "'" '{print $2}' | node -e "process.stdin.on('data', function(d) {console.log( JSON.stringify(d.toString().split('\n').filter(Boolean), null, 2) )});"
将会产生以下重新格式化的结果:
[
"1.14.0-ft.1",
"1.14.0-ft.2",
"1.14.0-ft.3",
...
]
脚注:
1 此期望有点类似于不期望数字,7
并且8
将从这组八个数字中返回;1
,2
,3
,4
,5
,6
,7
,8
,限定用于该范围的边界时,要被捕捉为>=0 <10
。
对于本问答的任何新读者,您可能有兴趣阅读此处评论中的讨论,这些评论是在提供此答案之前进行的。向@jwdonahue提出宝贵的意见。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句