Skip to content

Commit

Permalink
feat: drop node 10, 11, and programmatic api
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This will drop official support for node versions less
than v12.  It also removes the `main` export as something that will
work, effectively dropping a supported programmatic api via
`require('npm')`
  • Loading branch information
wraithgar committed Sep 15, 2021
1 parent 2def17a commit 71c9508
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Expand Up @@ -58,7 +58,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [10.x, 12.x, 14.x, 16.x]
node-version: [12.x, 14.x, 16.x]
platform:
- os: ubuntu-latest
shell: bash
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [10.x, 12.x, 14.x, 16.x]
node-version: [12.x, 14.x, 16.x]
platform:
- os: ubuntu-latest
shell: bash
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: ['10.1', 10.x, '12.1', 12.x, '14.1', 14.x, '16.1', 16.x]
node-version: ['12.13.0', 12.x, '14.15.0', 14.x, '16.1', 16.x]
platform:
- os: ubuntu-latest
shell: bash
Expand Down
2 changes: 2 additions & 0 deletions lib/npm.js
Expand Up @@ -358,3 +358,5 @@ const npm = module.exports = new class extends EventEmitter {

if (require.main === module)
require('./cli.js')(process)
else
throw new Error('The programmatic API was removed in npm v8.0.0')
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -235,6 +235,6 @@
},
"license": "Artistic-2.0",
"engines": {
"node": ">=10"
"node": "^12.13.0 || ^14.15.0 || >=16"
}
}
13 changes: 9 additions & 4 deletions test/lib/utils/unsupported.js
Expand Up @@ -27,10 +27,15 @@ const versions = [
['v7.2.3', false, true],
['v8.4.0', false, true],
['v9.3.0', false, true],
['v10.0.0-0', false, false],
['v11.0.0-0', false, false],
['v12.0.0-0', false, false],
['v13.0.0-0', false, false],
['v10.0.0-0', false, true],
['v11.0.0-0', false, true],
['v12.0.0-0', false, true],
['v12.13.0-0', false, false],
['v13.0.0-0', false, true],
['v14.0.0-0', false, true],
['v14.15.0-0', false, false],
['v15.0.0-0', false, true],
['v16.0.0-0', false, false],
]

t.test('versions', function (t) {
Expand Down

0 comments on commit 71c9508

Please sign in to comment.