Skip to content

Commit

Permalink
Require Node.js 18
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Aug 31, 2023
1 parent 33ff103 commit abc06fb
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .github/security.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Security Policy

To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
6 changes: 4 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ jobs:
fail-fast: false
matrix:
node-version:
- 20
- 18
- 16
- 14
- 12
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
Expand Down
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
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`.
@param message - Custom message.
@param message - A custom message.
@example
```
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import process from 'node:process';
import chalk from 'chalk';
import isRoot from 'is-root';
import isDocker from 'is-docker';
Expand Down
19 changes: 11 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"exports": {
"types": "./index.d.ts",
"default": "./index.js"
},
"engines": {
"node": ">=12"
"node": ">=18"
},
"scripts": {
"//test": "xo && ava && tsd",
Expand All @@ -34,15 +37,15 @@
"stop"
],
"dependencies": {
"chalk": "^4.1.1",
"is-docker": "^2.2.1",
"chalk": "^5.3.0",
"is-docker": "^3.0.0",
"is-root": "^3.0.0"
},
"devDependencies": {
"ava": "^3.15.0",
"ava": "^5.3.1",
"import-fresh": "^3.3.0",
"sinon": "^10.0.0",
"tsd": "^0.14.0",
"xo": "^0.39.1"
"sinon": "^15.2.0",
"tsd": "^0.29.0",
"xo": "^0.56.0"
}
}
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

## Install

```
$ npm install sudo-block
```sh
npm install sudo-block
```

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

Type: `string`

Custom message.
A custom message.
3 changes: 2 additions & 1 deletion test/docker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import fs from 'fs';
import process from 'node:process';
import fs from 'node:fs';
import test from 'ava';
import sinon from 'sinon';
import importFresh from 'import-fresh';
Expand Down
3 changes: 2 additions & 1 deletion test/sudo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import fs from 'fs';
import process from 'node:process';
import fs from 'node:fs';
import test from 'ava';
import sinon from 'sinon';
import importFresh from 'import-fresh';
Expand Down
3 changes: 2 additions & 1 deletion test/user.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import fs from 'fs';
import process from 'node:process';
import fs from 'node:fs';
import test from 'ava';
import sinon from 'sinon';
import importFresh from 'import-fresh';
Expand Down

0 comments on commit abc06fb

Please sign in to comment.