Skip to content

Commit abc06fb

Browse files
committed
Require Node.js 18
1 parent 33ff103 commit abc06fb

File tree

9 files changed

+29
-17
lines changed

9 files changed

+29
-17
lines changed

.github/security.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Security Policy
2+
3+
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.

.github/workflows/main.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
node-version:
13+
- 20
14+
- 18
1315
- 16
1416
- 14
1517
- 12
1618
steps:
17-
- uses: actions/checkout@v2
18-
- uses: actions/setup-node@v2
19+
- uses: actions/checkout@v3
20+
- uses: actions/setup-node@v3
1921
with:
2022
node-version: ${{ matrix.node-version }}
2123
- run: npm install

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
Block users from running your app with root permissions. When a file containing this function is run with root permissions it will exit and show an error message telling the user how to fix the problem, so they don't have to run it with `sudo`.
33
4-
@param message - Custom message.
4+
@param message - A custom message.
55
66
@example
77
```

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import process from 'node:process';
12
import chalk from 'chalk';
23
import isRoot from 'is-root';
34
import isDocker from 'is-docker';

package.json

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@
1111
"url": "https://sindresorhus.com"
1212
},
1313
"type": "module",
14-
"exports": "./index.js",
14+
"exports": {
15+
"types": "./index.d.ts",
16+
"default": "./index.js"
17+
},
1518
"engines": {
16-
"node": ">=12"
19+
"node": ">=18"
1720
},
1821
"scripts": {
1922
"//test": "xo && ava && tsd",
@@ -34,15 +37,15 @@
3437
"stop"
3538
],
3639
"dependencies": {
37-
"chalk": "^4.1.1",
38-
"is-docker": "^2.2.1",
40+
"chalk": "^5.3.0",
41+
"is-docker": "^3.0.0",
3942
"is-root": "^3.0.0"
4043
},
4144
"devDependencies": {
42-
"ava": "^3.15.0",
45+
"ava": "^5.3.1",
4346
"import-fresh": "^3.3.0",
44-
"sinon": "^10.0.0",
45-
"tsd": "^0.14.0",
46-
"xo": "^0.39.1"
47+
"sinon": "^15.2.0",
48+
"tsd": "^0.29.0",
49+
"xo": "^0.56.0"
4750
}
4851
}

readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
## Install
88

9-
```
10-
$ npm install sudo-block
9+
```sh
10+
npm install sudo-block
1111
```
1212

1313
## Usage
@@ -28,4 +28,4 @@ When a file containing this function is run with root permissions it will exit a
2828

2929
Type: `string`
3030

31-
Custom message.
31+
A custom message.

test/docker.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import fs from 'fs';
1+
import process from 'node:process';
2+
import fs from 'node:fs';
23
import test from 'ava';
34
import sinon from 'sinon';
45
import importFresh from 'import-fresh';

test/sudo.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import fs from 'fs';
1+
import process from 'node:process';
2+
import fs from 'node:fs';
23
import test from 'ava';
34
import sinon from 'sinon';
45
import importFresh from 'import-fresh';

test/user.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import fs from 'fs';
1+
import process from 'node:process';
2+
import fs from 'node:fs';
23
import test from 'ava';
34
import sinon from 'sinon';
45
import importFresh from 'import-fresh';

0 commit comments

Comments
 (0)