Skip to content

Commit eee9e86

Browse files
committed
Rebuilt readme with tldw
1 parent 7ee6ff6 commit eee9e86

File tree

1 file changed

+39
-24
lines changed

1 file changed

+39
-24
lines changed

readme.md

Lines changed: 39 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
# read-file-string
22

33

4-
<a href="https://raw.githubusercontent.com/jaid/read-file-string/master/license.txt"><img src="https://img.shields.io/github/license/jaid/read-file-string?style=flat-square" alt="License"/></a> <a href="https://github.com/sponsors/jaid"><img src="https://img.shields.io/badge/<3-Sponsor-FF45F1?style=flat-square" alt="Sponsor read-file-string"/></a>
5-
<a href="https://actions-badge.atrox.dev/jaid/read-file-string/goto"><img src="https://img.shields.io/endpoint.svg?style=flat-square&url=https%3A%2F%2Factions-badge.atrox.dev%2Fjaid%2Fread-file-string%2Fbadge" alt="Build status"/></a> <a href="https://github.com/jaid/read-file-string/commits"><img src="https://img.shields.io/github/commits-since/jaid/read-file-string/v1.0.1?style=flat-square&logo=github" alt="Commits since v1.0.1"/></a> <a href="https://github.com/jaid/read-file-string/commits"><img src="https://img.shields.io/github/last-commit/jaid/read-file-string?style=flat-square&logo=github" alt="Last commit"/></a> <a href="https://github.com/jaid/read-file-string/issues"><img src="https://img.shields.io/github/issues/jaid/read-file-string?style=flat-square&logo=github" alt="Issues"/></a>
6-
<a href="https://npmjs.com/package/read-file-string"><img src="https://img.shields.io/npm/v/read-file-string?style=flat-square&logo=npm&label=latest%20version" alt="Latest version on npm"/></a> <a href="https://github.com/jaid/read-file-string/network/dependents"><img src="https://img.shields.io/librariesio/dependents/npm/read-file-string?style=flat-square&logo=npm" alt="Dependents"/></a> <a href="https://npmjs.com/package/read-file-string"><img src="https://img.shields.io/npm/dm/read-file-string?style=flat-square&logo=npm" alt="Downloads"/></a>
7-
8-
**Returns file content as a UTF-8 string. Returns null if file does not exist (or is a directory) instead of throwing an Error.**
9-
10-
11-
12-
13-
4+
Returns file content as a UTF-8 string. Returns null if file does not exist (or is a directory) instead of throwing an Error.
145

6+
<a href="https://raw.githubusercontent.com/Jaid/read-file-string/master/license.txt"><img src="https://img.shields.io/github/license/Jaid/read-file-string?style=flat-square&color=success" alt="License"/></a>
7+
<a href="https://github.com/Jaid/read-file-string/commits"><img src="https://img.shields.io/github/commits-since/Jaid/read-file-string/v1.0.1?style=flat-square&logo=github&color=success" alt="Commits since v1.0.1"/></a> <a href="https://github.com/Jaid/read-file-string/commits"><img src="https://img.shields.io/github/last-commit/Jaid/read-file-string?style=flat-square&logo=github&color=red" alt="Last commit"/></a> <a href="https://github.com/Jaid/read-file-string/issues"><img src="https://img.shields.io/github/issues/Jaid/read-file-string?style=flat-square&logo=github&color=red" alt="Issues"/></a>
8+
<a href="https://npmjs.com/package/read-file-string"><img src="https://img.shields.io/npm/v/read-file-string?style=flat-square&logo=npm&label=latest%20version&color=success" alt="Latest version on npm"/></a> <a href="https://github.com/Jaid/read-file-string/network/dependents"><img src="https://img.shields.io/librariesio/dependents/npm/read-file-string?style=flat-square&logo=npm&color=red" alt="Dependents"/></a> <a href="https://npmjs.com/package/read-file-string"><img src="https://img.shields.io/npm/dm/read-file-string?style=flat-square&logo=npm&color=red" alt="Downloads"/></a>
159

1610

1711

@@ -33,30 +27,51 @@ yarn add read-file-string@^1.0.1
3327

3428

3529

30+
<a name="module_read-file-string"></a>
3631

32+
## Reference
3733

34+
* [read-file-string](#module_read-file-string)
35+
* [module.exports(file)](#exp_module_read-file-string--module.exports) ⇒ <code>Promise.&lt;(string\|null)&gt;</code> ⏏
36+
* [.readFileStringSync(file)](#module_read-file-string--module.exports.readFileStringSync) ⇒ <code>string</code> \| <code>null</code>
3837

38+
<a name="exp_module_read-file-string--module.exports"></a>
3939

40-
## Development
41-
40+
### module.exports(file) ⇒ <code>Promise.&lt;(string\|null)&gt;</code> ⏏
41+
**Kind**: Exported function
42+
**Returns**: <code>Promise.&lt;(string\|null)&gt;</code> - File contents in UTF-8 or null if file could not be read
4243

44+
| Param | Type | Description |
45+
| --- | --- | --- |
46+
| file | <code>string</code> | Path to a file |
4347

44-
Setting up:
45-
```bash
46-
git clone [email protected]:jaid/read-file-string.git
47-
cd read-file-string
48-
npm install
48+
**Example**
49+
```javascript
50+
import readFileString from "read-file-string"
51+
const result = await readFileString("readme.md")
52+
result === "## Hewwo OwO"
4953
```
50-
Testing:
51-
```bash
52-
npm run test:dev
53-
```
54-
Testing in production environment:
55-
```bash
56-
npm run test
54+
<a name="module_read-file-string--module.exports.readFileStringSync"></a>
55+
56+
#### module.exports.readFileStringSync(file) ⇒ <code>string</code> \| <code>null</code>
57+
**Kind**: static method of [<code>module.exports</code>](#exp_module_read-file-string--module.exports)
58+
**Returns**: <code>string</code> \| <code>null</code> - File contents in UTF-8 or null if file could not be read
59+
60+
| Param | Type | Description |
61+
| --- | --- | --- |
62+
| file | <code>string</code> | Path to a file |
63+
64+
**Example**
65+
```javascript
66+
import {readFileStringSync} from "read-file-string"
67+
const result = readFileStringSync("readme.md")
68+
result === "## Hewwo OwO"
5769
```
5870

5971

72+
73+
74+
6075
## License
6176
```text
6277
MIT License

0 commit comments

Comments
 (0)