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 Oct 28, 2023
1 parent 91822b6 commit 8d6379c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 28 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ jobs:
fail-fast: false
matrix:
node-version:
- 16
- 20
- 18
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install
Expand Down
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export interface Options {
export type Options = {
/**
Show the cursor. This can be useful when a CLI accepts input from a user.
Expand All @@ -13,7 +13,7 @@ export interface Options {
```
*/
readonly showCursor?: boolean;
}
};

type LogUpdateMethods = {
/**
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const getWidth = stream => {
};

const fitToTerminalHeight = (stream, text) => {
const terminalHeight = stream.rows || defaultTerminalHeight;
const terminalHeight = stream.rows ?? defaultTerminalHeight;
const lines = text.split('\n');

const toRemove = lines.length - terminalHeight;
Expand Down
28 changes: 18 additions & 10 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.20.0 || ^14.13.1 || >=16.0.0"
"node": ">=18"
},
"scripts": {
"test": "xo && ava && tsd"
Expand Down Expand Up @@ -41,18 +44,23 @@
"animation"
],
"dependencies": {
"ansi-escapes": "^5.0.0",
"ansi-escapes": "^6.2.0",
"cli-cursor": "^4.0.0",
"slice-ansi": "^5.0.0",
"strip-ansi": "^7.0.1",
"wrap-ansi": "^8.0.1"
"slice-ansi": "^7.0.0",
"strip-ansi": "^7.1.0",
"wrap-ansi": "^9.0.0"
},
"devDependencies": {
"@types/node": "^17.0.25",
"ava": "^4.2.0",
"@types/node": "^20.8.9",
"ava": "^5.3.1",
"terminal.js": "^1.0.11",
"tsd": "^0.20.0",
"tsd": "^0.29.0",
"wcwidth": "^1.0.1",
"xo": "^0.48.0"
"xo": "^0.56.0"
},
"xo": {
"rules": {
"@typescript-eslint/no-unsafe-argument": "off"
}
}
}
12 changes: 0 additions & 12 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,3 @@ const log = createLogUpdate(process.stdout, {
- [listr](https://github.com/SamVerschueren/listr) - Uses this module to render an interactive task list
- [ora](https://github.com/sindresorhus/ora) - Uses this module to render awesome spinners
- [speed-test](https://github.com/sindresorhus/speed-test) - Uses this module to render a [spinner](https://github.com/sindresorhus/elegant-spinner)

---

<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-log-update?utm_source=npm-log-update&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>

0 comments on commit 8d6379c

Please sign in to comment.