Skip to content

Commit 540e097

Browse files
committed
Fix documentation comments
1 parent 35ac564 commit 540e097

File tree

8 files changed

+239
-218
lines changed

8 files changed

+239
-218
lines changed

docs/Node/FS.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
data FS :: !
77
```
88

9+
Effect type for file system usage.
10+
911
#### `FileDescriptor`
1012

1113
``` purescript
@@ -30,12 +32,21 @@ data FileFlags
3032
| AX_PLUS
3133
```
3234

35+
##### Instances
36+
``` purescript
37+
instance showFileFlags :: Show FileFlags
38+
instance eqFileFlags :: Eq FileFlags
39+
```
40+
3341
#### `fileFlagsToNode`
3442

3543
``` purescript
3644
fileFlagsToNode :: FileFlags -> String
3745
```
3846

47+
Convert a `FileFlags` to a `String` in the format expected by the Node.js
48+
filesystem API.
49+
3950
#### `FileMode`
4051

4152
``` purescript
@@ -75,6 +86,8 @@ data SymlinkType
7586
| JunctionLink
7687
```
7788

89+
Symlink varieties.
90+
7891
##### Instances
7992
``` purescript
8093
instance showSymlinkType :: Show SymlinkType
@@ -87,4 +100,7 @@ instance eqSymlinkType :: Eq SymlinkType
87100
symlinkTypeToNode :: SymlinkType -> String
88101
```
89102

103+
Convert a `SymlinkType` to a `String` in the format expected by the
104+
Node.js filesystem API.
105+
90106

docs/Node/FS/Async.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,144 +6,193 @@
66
type Callback eff a = Either Error a -> Eff (fs :: FS | eff) Unit
77
```
88

9+
Type synonym for callback functions.
10+
911
#### `rename`
1012

1113
``` purescript
1214
rename :: forall eff. FilePath -> FilePath -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
1315
```
1416

17+
Renames a file.
18+
1519
#### `truncate`
1620

1721
``` purescript
1822
truncate :: forall eff. FilePath -> Int -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
1923
```
2024

25+
Truncates a file to the specified length.
26+
2127
#### `chown`
2228

2329
``` purescript
2430
chown :: forall eff. FilePath -> Int -> Int -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
2531
```
2632

33+
Changes the ownership of a file.
34+
2735
#### `chmod`
2836

2937
``` purescript
3038
chmod :: forall eff. FilePath -> Perms -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
3139
```
3240

41+
Changes the permissions of a file.
42+
3343
#### `stat`
3444

3545
``` purescript
3646
stat :: forall eff. FilePath -> Callback eff Stats -> Eff (fs :: FS | eff) Unit
3747
```
3848

49+
Gets file statistics.
50+
3951
#### `link`
4052

4153
``` purescript
4254
link :: forall eff. FilePath -> FilePath -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
4355
```
4456

57+
Creates a link to an existing file.
58+
4559
#### `symlink`
4660

4761
``` purescript
4862
symlink :: forall eff. FilePath -> FilePath -> SymlinkType -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
4963
```
5064

65+
Creates a symlink.
66+
5167
#### `readlink`
5268

5369
``` purescript
5470
readlink :: forall eff. FilePath -> Callback eff FilePath -> Eff (fs :: FS | eff) Unit
5571
```
5672

73+
Reads the value of a symlink.
74+
5775
#### `realpath`
5876

5977
``` purescript
6078
realpath :: forall eff. FilePath -> Callback eff FilePath -> Eff (fs :: FS | eff) Unit
6179
```
6280

81+
Find the canonicalized absolute location for a path.
82+
6383
#### `realpath'`
6484

6585
``` purescript
6686
realpath' :: forall eff cache. FilePath -> { | cache } -> Callback eff FilePath -> Eff (fs :: FS | eff) Unit
6787
```
6888

89+
Find the canonicalized absolute location for a path using a cache object
90+
for already resolved paths.
91+
6992
#### `unlink`
7093

7194
``` purescript
7295
unlink :: forall eff. FilePath -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
7396
```
7497

98+
Deletes a file.
99+
75100
#### `rmdir`
76101

77102
``` purescript
78103
rmdir :: forall eff. FilePath -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
79104
```
80105

106+
Deletes a directory.
107+
81108
#### `mkdir`
82109

83110
``` purescript
84111
mkdir :: forall eff. FilePath -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
85112
```
86113

114+
Makes a new directory.
115+
87116
#### `mkdir'`
88117

89118
``` purescript
90119
mkdir' :: forall eff. FilePath -> Perms -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
91120
```
92121

122+
Makes a new directory with the specified permissions.
123+
93124
#### `readdir`
94125

95126
``` purescript
96127
readdir :: forall eff. FilePath -> Callback eff (Array FilePath) -> Eff (fs :: FS | eff) Unit
97128
```
98129

130+
Reads the contents of a directory.
131+
99132
#### `utimes`
100133

101134
``` purescript
102135
utimes :: forall eff. FilePath -> Date -> Date -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
103136
```
104137

138+
Sets the accessed and modified times for the specified file.
139+
105140
#### `readFile`
106141

107142
``` purescript
108143
readFile :: forall eff. FilePath -> Callback (buffer :: BUFFER | eff) Buffer -> Eff (buffer :: BUFFER, fs :: FS | eff) Unit
109144
```
110145

146+
Reads the entire contents of a file returning the result as a raw buffer.
147+
111148
#### `readTextFile`
112149

113150
``` purescript
114151
readTextFile :: forall eff. Encoding -> FilePath -> Callback eff String -> Eff (fs :: FS | eff) Unit
115152
```
116153

154+
Reads the entire contents of a text file with the specified encoding.
155+
117156
#### `writeFile`
118157

119158
``` purescript
120159
writeFile :: forall eff. FilePath -> Buffer -> Callback (buffer :: BUFFER | eff) Unit -> Eff (buffer :: BUFFER, fs :: FS | eff) Unit
121160
```
122161

162+
Writes a buffer to a file.
163+
123164
#### `writeTextFile`
124165

125166
``` purescript
126167
writeTextFile :: forall eff. Encoding -> FilePath -> String -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
127168
```
128169

170+
Writes text to a file using the specified encoding.
171+
129172
#### `appendFile`
130173

131174
``` purescript
132175
appendFile :: forall eff. FilePath -> Buffer -> Callback (buffer :: BUFFER | eff) Unit -> Eff (buffer :: BUFFER, fs :: FS | eff) Unit
133176
```
134177

178+
Appends the contents of a buffer to a file.
179+
135180
#### `appendTextFile`
136181

137182
``` purescript
138183
appendTextFile :: forall eff. Encoding -> FilePath -> String -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
139184
```
140185

186+
Appends text to a file using the specified encoding.
187+
141188
#### `exists`
142189

143190
``` purescript
144191
exists :: forall eff. FilePath -> (Boolean -> Eff (fs :: FS | eff) Unit) -> Eff (fs :: FS | eff) Unit
145192
```
146193

194+
Check if the path exists.
195+
147196
#### `fdOpen`
148197

149198
``` purescript
@@ -156,28 +205,43 @@ fdOpen :: forall eff. FilePath -> FileFlags -> Maybe FileMode -> Callback eff Fi
156205
fdRead :: forall eff. FileDescriptor -> Buffer -> BufferOffset -> BufferLength -> Maybe FilePosition -> Callback (buffer :: BUFFER | eff) ByteCount -> Eff (buffer :: BUFFER, fs :: FS | eff) Unit
157206
```
158207

208+
Read from a file asynchronously. See the [Node Documentation](https://nodejs.org/api/fs.html#fs_fs_read_fd_buffer_offset_length_position_callback)
209+
for details.
210+
159211
#### `fdNext`
160212

161213
``` purescript
162214
fdNext :: forall eff. FileDescriptor -> Buffer -> Callback (buffer :: BUFFER | eff) ByteCount -> Eff (buffer :: BUFFER, fs :: FS | eff) Unit
163215
```
164216

217+
Convenience function to fill the whole buffer from the current
218+
file position.
219+
165220
#### `fdWrite`
166221

167222
``` purescript
168223
fdWrite :: forall eff. FileDescriptor -> Buffer -> BufferOffset -> BufferLength -> Maybe FilePosition -> Callback (buffer :: BUFFER | eff) ByteCount -> Eff (buffer :: BUFFER, fs :: FS | eff) Unit
169224
```
170225

226+
Write to a file asynchronously. See the [Node Documentation](https://nodejs.org/api/fs.html#fs_fs_write_fd_buffer_offset_length_position_callback)
227+
for details.
228+
171229
#### `fdAppend`
172230

173231
``` purescript
174232
fdAppend :: forall eff. FileDescriptor -> Buffer -> Callback (buffer :: BUFFER | eff) ByteCount -> Eff (buffer :: BUFFER, fs :: FS | eff) Unit
175233
```
176234

235+
Convenience function to append the whole buffer to the current
236+
file position.
237+
177238
#### `fdClose`
178239

179240
``` purescript
180241
fdClose :: forall eff. FileDescriptor -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
181242
```
182243

244+
Close a file asynchronously. See the [Node Documentation](https://nodejs.org/api/fs.html#fs_fs_close_fd_callback)
245+
for details.
246+
183247

docs/Node/FS/Stats.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ data Stats
1313
= Stats StatsObj
1414
```
1515

16+
Stats wrapper to provide a usable interface to the underlying properties and methods.
17+
1618
##### Instances
1719
``` purescript
1820
instance showStats :: Show Stats

0 commit comments

Comments
 (0)