Skip to content
This repository was archived by the owner on Aug 4, 2023. It is now read-only.

Commit 2f1c041

Browse files
committed
Update README and docs
1 parent 36a6067 commit 2f1c041

File tree

4 files changed

+245
-263
lines changed

4 files changed

+245
-263
lines changed

README.md

Lines changed: 10 additions & 237 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
## Module Node.FS.Aff
1+
## Node.FS.Aff
22

33

4-
[Node.FS][Node.FS] Wrappers for [purescript-aff][aff]
4+
> [Node.FS][Node.FS] Wrappers for [purescript-aff][aff]
55
66
The `Aff` monad let's you write async code with ease.
77

8+
#### Example
9+
810
Consider asynchronously listing only non-hidden directories:
911

1012
``` purescript
@@ -18,242 +20,13 @@ main = launchAff do
1820
liftEff $ print files'
1921
```
2022

21-
That was easy. For a working example, see [example.purs][example].
22-
To build the example, run `gulp example`.
23-
24-
[Node.FS]: http://github.com/purescript-node/purescript-node-fs
25-
[aff]: https://github.com/slamdata/purescript-aff
26-
[example]: http://github.com/purescript-node/purescript-node-fs-aff/blob/master/example/example.purs
27-
28-
#### `rename`
29-
30-
``` purescript
31-
rename :: forall eff. FilePath -> FilePath -> Aff (fs :: FS | eff) Unit
32-
```
33-
34-
35-
Rename a file.
36-
37-
38-
#### `truncate`
39-
40-
``` purescript
41-
truncate :: forall eff. FilePath -> Number -> Aff (fs :: FS | eff) Unit
42-
```
43-
44-
45-
Truncates a file to the specified length.
46-
47-
48-
#### `chown`
49-
50-
``` purescript
51-
chown :: forall eff. FilePath -> Number -> Number -> Aff (fs :: FS | eff) Unit
52-
```
53-
54-
55-
Changes the ownership of a file.
56-
57-
58-
#### `chmod`
59-
60-
``` purescript
61-
chmod :: forall eff. FilePath -> Perms -> Aff (fs :: FS | eff) Unit
62-
```
63-
64-
65-
Changes the permissions of a file.
66-
23+
That was easy. Run `gulp example` to see it work.
6724

68-
#### `stat`
69-
70-
``` purescript
71-
stat :: forall eff. FilePath -> Aff (fs :: FS | eff) Stats
72-
```
73-
74-
75-
Gets file statistics.
76-
77-
78-
#### `link`
79-
80-
``` purescript
81-
link :: forall eff. FilePath -> FilePath -> Aff (fs :: FS | eff) Unit
82-
```
83-
84-
85-
Creates a link to an existing file.
86-
87-
88-
#### `symlink`
89-
90-
``` purescript
91-
symlink :: forall eff. FilePath -> FilePath -> SymlinkType -> Aff (fs :: FS | eff) Unit
92-
```
93-
94-
95-
Creates a symlink.
96-
97-
98-
#### `readlink`
99-
100-
``` purescript
101-
readlink :: forall eff. FilePath -> Aff (fs :: FS | eff) FilePath
102-
```
103-
104-
105-
Reads the value of a symlink.
106-
107-
108-
#### `realpath`
109-
110-
``` purescript
111-
realpath :: forall eff. FilePath -> Aff (fs :: FS | eff) FilePath
112-
```
113-
114-
115-
Find the canonicalized absolute location for a path.
116-
117-
118-
#### `realpath'`
119-
120-
``` purescript
121-
realpath' :: forall eff cache. FilePath -> { | cache } -> Aff (fs :: FS | eff) FilePath
122-
```
123-
124-
125-
Find the canonicalized absolute location for a path using a cache object
126-
for already resolved paths.
127-
128-
129-
#### `unlink`
130-
131-
``` purescript
132-
unlink :: forall eff. FilePath -> Aff (fs :: FS | eff) Unit
133-
```
134-
135-
136-
Deletes a file.
137-
138-
139-
#### `rmdir`
140-
141-
``` purescript
142-
rmdir :: forall eff. FilePath -> Aff (fs :: FS | eff) Unit
143-
```
144-
145-
146-
Deletes a directory.
147-
148-
149-
#### `mkdir`
150-
151-
``` purescript
152-
mkdir :: forall eff. FilePath -> Aff (fs :: FS | eff) Unit
153-
```
154-
155-
156-
Makes a new directory.
157-
158-
159-
#### `mkdir'`
160-
161-
``` purescript
162-
mkdir' :: forall eff. FilePath -> Perms -> Aff (fs :: FS | eff) Unit
163-
```
164-
165-
166-
Makes a new directory with the specified permissions.
167-
168-
169-
#### `readdir`
170-
171-
``` purescript
172-
readdir :: forall eff. FilePath -> Aff (fs :: FS | eff) (Array FilePath)
173-
```
174-
175-
176-
Reads the contents of a directory.
177-
178-
179-
#### `utimes`
180-
181-
``` purescript
182-
utimes :: forall eff. FilePath -> Date -> Date -> Aff (fs :: FS | eff) Unit
183-
```
184-
185-
186-
Sets the accessed and modified times for the specified file.
187-
188-
189-
#### `readFile`
190-
191-
``` purescript
192-
readFile :: forall eff. FilePath -> Aff (fs :: FS | eff) Buffer
193-
```
194-
195-
196-
Reads the entire contents of a file returning the result as a raw buffer.
197-
198-
199-
#### `readTextFile`
200-
201-
``` purescript
202-
readTextFile :: forall eff. Encoding -> FilePath -> Aff (fs :: FS | eff) String
203-
```
204-
205-
206-
Reads the entire contents of a text file with the specified encoding.
207-
208-
209-
#### `writeFile`
210-
211-
``` purescript
212-
writeFile :: forall eff. FilePath -> Buffer -> Aff (fs :: FS | eff) Unit
213-
```
214-
215-
216-
Writes a buffer to a file.
217-
218-
219-
#### `writeTextFile`
220-
221-
``` purescript
222-
writeTextFile :: forall eff. Encoding -> FilePath -> String -> Aff (fs :: FS | eff) Unit
223-
```
224-
225-
226-
Writes text to a file using the specified encoding.
227-
228-
229-
#### `appendFile`
230-
231-
``` purescript
232-
appendFile :: forall eff. FilePath -> Buffer -> Aff (fs :: FS | eff) Unit
233-
```
234-
235-
236-
Appends the contents of a buffer to a file.
237-
238-
239-
#### `appendTextFile`
240-
241-
``` purescript
242-
appendTextFile :: forall eff. Encoding -> FilePath -> String -> Aff (fs :: FS | eff) Unit
243-
```
244-
245-
246-
Appends text to a file using the specified encoding.
247-
248-
249-
#### `exists`
250-
251-
``` purescript
252-
exists :: forall eff. String -> Aff (fs :: FS | eff) Boolean
253-
```
254-
255-
256-
Check to see if a file exists.
25+
#### Documentation
25726

27+
[Read the module docs][docs]
25828

25929

30+
[Node.FS]: http://github.com/purescript-node/purescript-node-fs
31+
[aff]: https://github.com/slamdata/purescript-aff
32+
[docs]: http://github.com/purescript-node/purescript-node-fs-aff/blob/master/docs/Node/FS/Aff.md

0 commit comments

Comments
 (0)