@magic/fs 0.0.27 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -13
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -12,12 +12,15 @@ exports all fs.promises + exists + mkdirp + rmrf + getFiles + getDirs functions.
|
|
|
12
12
|
[html-docs](https://magic.github.io/fs)
|
|
13
13
|
|
|
14
14
|
### installation
|
|
15
|
+
|
|
15
16
|
be in a nodejs project
|
|
17
|
+
|
|
16
18
|
```bash
|
|
17
19
|
npm install @magic/fs
|
|
18
20
|
```
|
|
19
21
|
|
|
20
22
|
### import
|
|
23
|
+
|
|
21
24
|
```javascript
|
|
22
25
|
import fs from '@magic/fs'
|
|
23
26
|
|
|
@@ -31,7 +34,9 @@ run()
|
|
|
31
34
|
```
|
|
32
35
|
|
|
33
36
|
### promises
|
|
37
|
+
|
|
34
38
|
promises from fs:
|
|
39
|
+
|
|
35
40
|
```
|
|
36
41
|
access
|
|
37
42
|
copyFile
|
|
@@ -65,6 +70,7 @@ rmDir
|
|
|
65
70
|
```
|
|
66
71
|
|
|
67
72
|
### export overloads:
|
|
73
|
+
|
|
68
74
|
```javascript
|
|
69
75
|
rmdir, rmDir
|
|
70
76
|
readfile, readFile
|
|
@@ -74,6 +80,7 @@ readdir, readDir
|
|
|
74
80
|
### Additional functions:
|
|
75
81
|
|
|
76
82
|
#### mkdirp
|
|
83
|
+
|
|
77
84
|
same as mkdir -p on unix
|
|
78
85
|
|
|
79
86
|
```javascript
|
|
@@ -81,17 +88,21 @@ await fs.mkdirp('./path/to/dir')
|
|
|
81
88
|
```
|
|
82
89
|
|
|
83
90
|
#### rmrf
|
|
91
|
+
|
|
84
92
|
same as rm -rf on unix.
|
|
85
93
|
|
|
86
94
|
**will not work outside process.cwd()**
|
|
95
|
+
|
|
87
96
|
```javascript
|
|
88
97
|
await fs.rmrf('./path/to/dir')
|
|
89
98
|
```
|
|
90
99
|
|
|
91
100
|
#### exists
|
|
101
|
+
|
|
92
102
|
same as fs.exists, but promisified and ready for esmodules.
|
|
93
103
|
|
|
94
104
|
#### getDirectories
|
|
105
|
+
|
|
95
106
|
get a list of directories in a directory,
|
|
96
107
|
recursively.
|
|
97
108
|
|
|
@@ -122,6 +133,7 @@ run()
|
|
|
122
133
|
```
|
|
123
134
|
|
|
124
135
|
#### getFiles
|
|
136
|
+
|
|
125
137
|
get a list of files in a directory,
|
|
126
138
|
recursively.
|
|
127
139
|
|
|
@@ -145,6 +157,7 @@ run()
|
|
|
145
157
|
```
|
|
146
158
|
|
|
147
159
|
#### getFileType
|
|
160
|
+
|
|
148
161
|
get the file type of a file,
|
|
149
162
|
based on extension,
|
|
150
163
|
and defaulting to "txt"
|
|
@@ -157,39 +170,47 @@ console.log(fileType, fileType === 'html')
|
|
|
157
170
|
|
|
158
171
|
const nonFileType = fs.getFileType()
|
|
159
172
|
console.log(nonFileType, nonFileType === 'txt')
|
|
160
|
-
|
|
161
173
|
```
|
|
162
174
|
|
|
163
175
|
### changelog
|
|
164
176
|
|
|
165
177
|
#### 0.0.1
|
|
178
|
+
|
|
166
179
|
first release
|
|
167
180
|
|
|
168
181
|
#### 0.0.2
|
|
169
|
-
|
|
170
|
-
|
|
182
|
+
|
|
183
|
+
- bump required node version
|
|
184
|
+
- update dependencies
|
|
171
185
|
|
|
172
186
|
#### 0.0.3
|
|
187
|
+
|
|
173
188
|
better error messages
|
|
174
189
|
|
|
175
190
|
#### 0.0.4
|
|
191
|
+
|
|
176
192
|
rmrf returns true if directory does not exist.
|
|
177
193
|
|
|
178
194
|
#### 0.0.5
|
|
195
|
+
|
|
179
196
|
use @magic/mime-types to export contentTypes
|
|
180
197
|
|
|
181
198
|
#### 0.0.6
|
|
199
|
+
|
|
182
200
|
bump required node version to 14.2.0
|
|
183
201
|
|
|
184
202
|
#### 0.0.7
|
|
203
|
+
|
|
185
204
|
rmrf: add dryRun option
|
|
186
205
|
|
|
187
206
|
#### 0.0.8
|
|
207
|
+
|
|
188
208
|
update dependencies
|
|
189
209
|
|
|
190
210
|
#### 0.0.9
|
|
191
|
-
|
|
192
|
-
|
|
211
|
+
|
|
212
|
+
- remove unused imports from getDirectories
|
|
213
|
+
- getDirectories and getFiles now accept a number as second argument.
|
|
193
214
|
|
|
194
215
|
```
|
|
195
216
|
// if a number is given instead of true/false, then this is the depth of recursion.
|
|
@@ -197,65 +218,87 @@ getFiles(directory, 2) // two levels down
|
|
|
197
218
|
```
|
|
198
219
|
|
|
199
220
|
#### 0.0.10
|
|
200
|
-
|
|
201
|
-
|
|
221
|
+
|
|
222
|
+
- bump required node version to 14.15.4
|
|
223
|
+
- update dependencies
|
|
202
224
|
|
|
203
225
|
##### 0.0.11
|
|
226
|
+
|
|
204
227
|
update dependencies (@magic/mime-types)
|
|
205
228
|
|
|
206
229
|
##### 0.0.12
|
|
230
|
+
|
|
207
231
|
export all functions from native fs
|
|
208
232
|
|
|
209
233
|
##### 0.0.13
|
|
210
|
-
|
|
211
|
-
|
|
234
|
+
|
|
235
|
+
- getDirectories, getFiles: default root to process.cwd() if first argument is an array and root is not passed
|
|
236
|
+
- update dependencies
|
|
212
237
|
|
|
213
238
|
##### 0.0.14
|
|
239
|
+
|
|
214
240
|
update dependencies (@magic/mime-types)
|
|
215
241
|
|
|
216
242
|
##### 0.0.15
|
|
243
|
+
|
|
217
244
|
update @magic/types to avoid circular dependency
|
|
218
245
|
|
|
219
246
|
##### 0.0.16
|
|
247
|
+
|
|
220
248
|
add deprecation warning for calls to fs.getDirectories, fs.getFilePath and fs.getFiles that do not use an options object
|
|
221
249
|
|
|
222
250
|
##### 0.0.17
|
|
251
|
+
|
|
223
252
|
update dependencies
|
|
224
253
|
|
|
225
254
|
##### 0.0.18
|
|
255
|
+
|
|
226
256
|
update mime-types
|
|
227
257
|
|
|
228
258
|
##### 0.0.19
|
|
259
|
+
|
|
229
260
|
update dependencies
|
|
230
261
|
|
|
231
262
|
##### 0.0.20
|
|
263
|
+
|
|
232
264
|
update dependencies
|
|
233
265
|
|
|
234
266
|
##### 0.0.21
|
|
235
|
-
|
|
236
|
-
|
|
267
|
+
|
|
268
|
+
- add missing @magic/fs dependency
|
|
269
|
+
- update dependencies
|
|
237
270
|
|
|
238
271
|
##### 0.0.22
|
|
272
|
+
|
|
239
273
|
update dependencies
|
|
240
274
|
|
|
241
275
|
##### 0.0.23
|
|
276
|
+
|
|
242
277
|
update dependencies
|
|
243
278
|
|
|
244
279
|
##### 0.0.24
|
|
280
|
+
|
|
245
281
|
getFiles: allow files to be filtered by extension, using the .extension key of the second parameter
|
|
246
282
|
|
|
247
283
|
##### 0.0.25
|
|
284
|
+
|
|
248
285
|
update dependencies
|
|
249
286
|
|
|
250
287
|
##### 0.0.26
|
|
288
|
+
|
|
251
289
|
update dependencies
|
|
252
290
|
|
|
253
291
|
##### 0.0.27
|
|
292
|
+
|
|
254
293
|
update dependencies
|
|
255
294
|
|
|
256
|
-
##### 0.0.28
|
|
257
|
-
|
|
295
|
+
##### 0.0.28
|
|
296
|
+
|
|
297
|
+
update dependencies
|
|
258
298
|
|
|
299
|
+
##### 0.0.29 - unreleased
|
|
300
|
+
|
|
301
|
+
...
|
|
259
302
|
|
|
260
303
|
[npm-image]: https://img.shields.io/npm/v/@magic/fs.svg
|
|
261
304
|
[npm-url]: https://www.npmjs.com/package/@magic/fs
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magic/fs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.28",
|
|
4
4
|
"author": "Wizards & Witches",
|
|
5
5
|
"description": "nodejs fs promises + goodies",
|
|
6
6
|
"license": "AGPL-3.0",
|
|
@@ -34,19 +34,19 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@magic-modules/git-badges": "0.0.12",
|
|
36
36
|
"@magic-modules/light-switch": "0.0.11",
|
|
37
|
-
"@magic-modules/no-spy": "0.0.
|
|
37
|
+
"@magic-modules/no-spy": "0.0.8",
|
|
38
38
|
"@magic-modules/pre": "0.0.11",
|
|
39
39
|
"@magic-themes/docs": "0.0.14",
|
|
40
|
-
"@magic/core": "0.0.
|
|
41
|
-
"@magic/format": "0.0.
|
|
42
|
-
"@magic/test": "0.2.
|
|
40
|
+
"@magic/core": "0.0.149",
|
|
41
|
+
"@magic/format": "0.0.50",
|
|
42
|
+
"@magic/test": "0.2.15"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@magic/deep": "0.1.
|
|
46
|
-
"@magic/error": "0.0.
|
|
47
|
-
"@magic/log": "0.1.
|
|
48
|
-
"@magic/mime-types": "0.0.
|
|
49
|
-
"@magic/types": "0.1.
|
|
45
|
+
"@magic/deep": "0.1.16",
|
|
46
|
+
"@magic/error": "0.0.17",
|
|
47
|
+
"@magic/log": "0.1.18",
|
|
48
|
+
"@magic/mime-types": "0.0.18",
|
|
49
|
+
"@magic/types": "0.1.23"
|
|
50
50
|
},
|
|
51
51
|
"files": [
|
|
52
52
|
"src"
|