Skip to content

Commit 598fca8

Browse files
committed
Require Node.js 18
1 parent a351047 commit 598fca8

File tree

6 files changed

+28
-26
lines changed

6 files changed

+28
-26
lines changed

.github/funding.yml

-2
This file was deleted.

.github/workflows/main.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
node-version:
13-
- 16
13+
- 22
14+
- 20
15+
- 18
1416
steps:
15-
- uses: actions/checkout@v2
16-
- uses: actions/setup-node@v2
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-node@v4
1719
with:
1820
node-version: ${{ matrix.node-version }}
1921
- run: npm install

index.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export type Replacer = (this: unknown, key: string, value: unknown) => unknown;
22
export type SortKeys = (a: string, b: string) => number;
33

4-
export interface Options {
4+
export type Options = {
55
/**
66
Indentation as a string or number of spaces.
77
@@ -40,7 +40,7 @@ export interface Options {
4040
@default 0o666
4141
*/
4242
readonly mode?: number;
43-
}
43+
};
4444

4545
/**
4646
Stringify and write JSON to a file atomically.

index.test-d.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import {expectType, expectAssignable} from 'tsd';
2-
import {writeJsonFile, writeJsonFileSync, Replacer, SortKeys} from './index.js';
2+
import {
3+
writeJsonFile,
4+
writeJsonFileSync,
5+
type Replacer,
6+
type SortKeys,
7+
} from './index.js';
38

49
expectAssignable<SortKeys>(() => 1);
510
expectAssignable<SortKeys>((a: string) => a.length);

package.json

+13-9
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@
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+
},
18+
"sideEffects": false,
1519
"engines": {
16-
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
20+
"node": ">=18"
1721
},
1822
"scripts": {
1923
"test": "xo && ava && tsd"
@@ -37,15 +41,15 @@
3741
"atomically"
3842
],
3943
"dependencies": {
40-
"detect-indent": "^7.0.0",
41-
"is-plain-obj": "^4.0.0",
44+
"detect-indent": "^7.0.1",
45+
"is-plain-obj": "^4.1.0",
4246
"sort-keys": "^5.0.0",
43-
"write-file-atomic": "^3.0.3"
47+
"write-file-atomic": "^5.0.1"
4448
},
4549
"devDependencies": {
46-
"ava": "^3.15.0",
47-
"tempy": "^1.0.1",
48-
"tsd": "^0.17.0",
49-
"xo": "^0.44.0"
50+
"ava": "^6.1.3",
51+
"tempy": "^2.0.0",
52+
"tsd": "^0.31.1",
53+
"xo": "^0.59.2"
5054
}
5155
}

readme.md

+2-9
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Creates directories for you as needed.
66

77
## Install
88

9-
```
10-
$ npm install write-json-file
9+
```sh
10+
npm install write-json-file
1111
```
1212

1313
## Usage
@@ -70,14 +70,7 @@ Default: `0o666`
7070

7171
The [mode](https://en.wikipedia.org/wiki/File_system_permissions#Numeric_notation) used when writing the file.
7272

73-
## write-json-file for enterprise
74-
75-
Available as part of the Tidelift Subscription.
76-
77-
The maintainers of write-json-file and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-write-json-file?utm_source=npm-write-json-file&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
78-
7973
## Related
8074

8175
- [load-json-file](https://github.com/sindresorhus/load-json-file) - Read and parse a JSON file
8276
- [make-dir](https://github.com/sindresorhus/make-dir) - Make a directory and its parents if needed
83-

0 commit comments

Comments
 (0)