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

Commit da616bc

Browse files
committed
Merge pull request #2 (upgrade to purescript 0.7)
2 parents c45d0ba + eff769b commit da616bc

File tree

9 files changed

+339
-334
lines changed

9 files changed

+339
-334
lines changed

.eslintrc

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"env": {
3+
"node": true,
4+
},
5+
"rules": {
6+
"valid-jsdoc": [2, {
7+
"prefer": { "return": "returns" },
8+
"requireReturn": true,
9+
"requireParamDescription": true,
10+
"requireReturnDescription": false
11+
}],
12+
"camelcase": 1,
13+
"no-multi-spaces": 0,
14+
"comma-spacing": 1,
15+
"comma-style": [2, "first"],
16+
"consistent-return": 0,
17+
"eol-last": 1,
18+
"indent": [1, 4],
19+
"no-use-before-define": [2, "nofunc"],
20+
"no-process-exit": 0,
21+
"no-trailing-spaces": 1,
22+
"no-underscore-dangle": 0,
23+
"no-unused-vars": 1,
24+
"space-infix-ops": 1,
25+
"quotes": [1, "single"],
26+
"semi": [1, "always"],
27+
"semi-spacing": 1,
28+
"strict": [2, "global"],
29+
"yoda": [1, "never"]
30+
},
31+
"globals": {
32+
"describe": true,
33+
"it": true,
34+
"before": true,
35+
"beforeEach": true,
36+
"after": true,
37+
"afterEach": true
38+
}
39+
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
.psci_modules
12
*.sw[mnopqrstuv]
23
*.un~
34
.psci
45
node_modules
56
bower_components
67
output
8+
dist

README.md

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

3-
## Module Node.FS.Aff
43

5-
6-
7-
[Node.FS][Node.FS] Wrappers for [purescript-aff][aff]
4+
> [Node.FS][Node.FS] Wrappers for [purescript-aff][aff]
85
96
The `Aff` monad let's you write async code with ease.
107

8+
#### Example
9+
1110
Consider asynchronously listing only non-hidden directories:
1211

1312
``` purescript
@@ -18,246 +17,16 @@ main = launchAff do
1817
return $
1918
FS.isDirectory stat
2019
&& (maybe false (fromChar >>> (/= ".")) $ charAt 0 file)
21-
liftEff $ Debug.Trace.trace $ show files'
22-
```
23-
24-
That was easy. For a working example, see [example.purs][example].
25-
To build the example, run `gulp example`.
26-
27-
[Node.FS]: http://github.com/purescript-node/purescript-node-fs
28-
[aff]: https://github.com/slamdata/purescript-aff
29-
[example]: http://github.com/purescript-node/purescript-node-fs-aff/blob/master/example/example.purs
30-
31-
#### `rename`
32-
33-
``` purescript
34-
rename :: forall eff. FilePath -> FilePath -> Aff (fs :: F.FS | eff) Unit
35-
```
36-
37-
38-
Rename a file.
39-
40-
41-
#### `truncate`
42-
43-
``` purescript
44-
truncate :: forall eff. FilePath -> Number -> Aff (fs :: F.FS | eff) Unit
45-
```
46-
47-
48-
Truncates a file to the specified length.
49-
50-
51-
#### `chown`
52-
53-
``` purescript
54-
chown :: forall eff. FilePath -> Number -> Number -> Aff (fs :: F.FS | eff) Unit
55-
```
56-
57-
58-
Changes the ownership of a file.
59-
60-
61-
#### `chmod`
62-
63-
``` purescript
64-
chmod :: forall eff. FilePath -> Perms -> Aff (fs :: F.FS | eff) Unit
65-
```
66-
67-
68-
Changes the permissions of a file.
69-
70-
71-
#### `stat`
72-
73-
``` purescript
74-
stat :: forall eff. FilePath -> Aff (fs :: F.FS | eff) Stats
75-
```
76-
77-
78-
Gets file statistics.
79-
80-
81-
#### `link`
82-
83-
``` purescript
84-
link :: forall eff. FilePath -> FilePath -> Aff (fs :: F.FS | eff) Unit
85-
```
86-
87-
88-
Creates a link to an existing file.
89-
90-
91-
#### `symlink`
92-
93-
``` purescript
94-
symlink :: forall eff. FilePath -> FilePath -> F.SymlinkType -> Aff (fs :: F.FS | eff) Unit
95-
```
96-
97-
98-
Creates a symlink.
99-
100-
101-
#### `readlink`
102-
103-
``` purescript
104-
readlink :: forall eff. FilePath -> Aff (fs :: F.FS | eff) FilePath
105-
```
106-
107-
108-
Reads the value of a symlink.
109-
110-
111-
#### `realpath`
112-
113-
``` purescript
114-
realpath :: forall eff. FilePath -> Aff (fs :: F.FS | eff) FilePath
115-
```
116-
117-
118-
Find the canonicalized absolute location for a path.
119-
120-
121-
#### `realpath'`
122-
123-
``` purescript
124-
realpath' :: forall eff cache. FilePath -> { | cache } -> Aff (fs :: F.FS | eff) FilePath
125-
```
126-
127-
128-
Find the canonicalized absolute location for a path using a cache object
129-
for already resolved paths.
130-
131-
132-
#### `unlink`
133-
134-
``` purescript
135-
unlink :: forall eff. FilePath -> Aff (fs :: F.FS | eff) Unit
136-
```
137-
138-
139-
Deletes a file.
140-
141-
142-
#### `rmdir`
143-
144-
``` purescript
145-
rmdir :: forall eff. FilePath -> Aff (fs :: F.FS | eff) Unit
146-
```
147-
148-
149-
Deletes a directory.
150-
151-
152-
#### `mkdir`
153-
154-
``` purescript
155-
mkdir :: forall eff. FilePath -> Aff (fs :: F.FS | eff) Unit
156-
```
157-
158-
159-
Makes a new directory.
160-
161-
162-
#### `mkdir'`
163-
164-
``` purescript
165-
mkdir' :: forall eff. FilePath -> Perms -> Aff (fs :: F.FS | eff) Unit
166-
```
167-
168-
169-
Makes a new directory with the specified permissions.
170-
171-
172-
#### `readdir`
173-
174-
``` purescript
175-
readdir :: forall eff. FilePath -> Aff (fs :: F.FS | eff) [FilePath]
176-
```
177-
178-
179-
Reads the contents of a directory.
180-
181-
182-
#### `utimes`
183-
184-
``` purescript
185-
utimes :: forall eff. FilePath -> Date -> Date -> Aff (fs :: F.FS | eff) Unit
186-
```
187-
188-
189-
Sets the accessed and modified times for the specified file.
190-
191-
192-
#### `readFile`
193-
194-
``` purescript
195-
readFile :: forall eff. FilePath -> Aff (fs :: F.FS | eff) Buffer
196-
```
197-
198-
199-
Reads the entire contents of a file returning the result as a raw buffer.
200-
201-
202-
#### `readTextFile`
203-
204-
``` purescript
205-
readTextFile :: forall eff. Encoding -> FilePath -> Aff (fs :: F.FS | eff) String
206-
```
207-
208-
209-
Reads the entire contents of a text file with the specified encoding.
210-
211-
212-
#### `writeFile`
213-
214-
``` purescript
215-
writeFile :: forall eff. FilePath -> Buffer -> Aff (fs :: F.FS | eff) Unit
216-
```
217-
218-
219-
Writes a buffer to a file.
220-
221-
222-
#### `writeTextFile`
223-
224-
``` purescript
225-
writeTextFile :: forall eff. Encoding -> FilePath -> String -> Aff (fs :: F.FS | eff) Unit
226-
```
227-
228-
229-
Writes text to a file using the specified encoding.
230-
231-
232-
#### `appendFile`
233-
234-
``` purescript
235-
appendFile :: forall eff. FilePath -> Buffer -> Aff (fs :: F.FS | eff) Unit
236-
```
237-
238-
239-
Appends the contents of a buffer to a file.
240-
241-
242-
#### `appendTextFile`
243-
244-
``` purescript
245-
appendTextFile :: forall eff. Encoding -> FilePath -> String -> Aff (fs :: F.FS | eff) Unit
20+
liftEff $ print files'
24621
```
24722

23+
That was easy. Run `gulp example` to see it work.
24824

249-
Appends text to a file using the specified encoding.
250-
251-
252-
#### `exists`
253-
254-
``` purescript
255-
exists :: forall eff. String -> Aff (fs :: F.FS | eff) Boolean
256-
```
257-
258-
259-
Check to see if a file exists.
260-
25+
#### Documentation
26126

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

26329

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

bower.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
"tests"
2020
],
2121
"dependencies": {
22-
"purescript-aff": "~0.10.1",
23-
"purescript-node-fs": "~0.6.0",
24-
"purescript-either": "~0.1.8",
25-
"purescript-node-path": "~0.3.0"
22+
"purescript-aff": "~0.11.0",
23+
"purescript-node-fs": "~0.7.0",
24+
"purescript-either": "~0.2.0",
25+
"purescript-node-path": "~0.4.0"
2626
}
2727
}

0 commit comments

Comments
 (0)