Skip to content

Commit 613eb21

Browse files
Automatically merged commits from pull #2
Update readme.md with Jaid/action-readme
2 parents 90353e4 + 89a9f35 commit 613eb21

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

readme.md

+22-4
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,36 @@ yarn add read-file-string@^0.1.0
1616

1717

1818
## Documentation
19+
20+
* [read-file-string](#module_read-file-string)
21+
* [module.exports(file)](#exp_module_read-file-string--module.exports) ⇒ <code>Promise.&lt;string&gt;</code> ⏏
22+
* [.readFileStringSync(file)](#module_read-file-string--module.exports.readFileStringSync) ⇒ <code>string</code>
23+
1924
**Kind**: Exported function
20-
**Returns**: <code>Promise.&lt;(boolean\|null)&gt;</code> - `true` if repository is dirty, `false` if repository is clean, `null` if given directory is not a git repository
25+
**Returns**: <code>Promise.&lt;string&gt;</code> - File contents in UTF-8 or null if file could not be read
2126

2227
| Param | Type | Description |
2328
| --- | --- | --- |
24-
| directory | <code>string</code> | Absolute path to a git repository directory |
29+
| file | <code>string</code> | Path to a file |
2530

2631
**Example**
2732
```javascript
2833
import readFileString from "read-file-string"
29-
const result = await readFileString("/my/path")
30-
result === false
34+
const result = await readFileString("readme.md")
35+
result === "## Hewwo OwO"
36+
```
37+
**Kind**: static method of [<code>module.exports</code>](#exp_module_read-file-string--module.exports)
38+
**Returns**: <code>string</code> - File contents in UTF-8 or null if file could not be read
39+
40+
| Param | Type | Description |
41+
| --- | --- | --- |
42+
| file | <code>string</code> | Path to a file |
43+
44+
**Example**
45+
```javascript
46+
import {readFileStringSync} from "read-file-string"
47+
const result = readFileStringSync("readme.md")
48+
result === "## Hewwo OwO"
3149
```
3250

3351

0 commit comments

Comments
 (0)