|
1 | 1 | # read-file-string
|
2 |
| -## Under construction |
3 |
| -Not much to see right now. Come back lator! :crocodile: |
| 2 | + |
| 3 | + |
| 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. |
| 5 | + |
| 6 | +## Installation |
| 7 | +<a href='https://npmjs.com/package/read-file-string'><img alt='npm logo' src='https://github.com/Jaid/action-readme/raw/master/images/base-assets/npm.png'/></a> |
| 8 | +```bash |
| 9 | +npm install --save read-file-string@^0.1.0 |
| 10 | +``` |
| 11 | +<a href='https://yarnpkg.com/package/read-file-string'><img alt='Yarn logo' src='https://github.com/Jaid/action-readme/raw/master/images/base-assets/yarn.png'/></a> |
| 12 | +```bash |
| 13 | +yarn add read-file-string@^0.1.0 |
| 14 | +``` |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | +## Documentation |
| 19 | +**Kind**: Exported function |
| 20 | +**Returns**: <code>Promise.<(boolean\|null)></code> - `true` if repository is dirty, `false` if repository is clean, `null` if given directory is not a git repository |
| 21 | + |
| 22 | +| Param | Type | Description | |
| 23 | +| --- | --- | --- | |
| 24 | +| directory | <code>string</code> | Absolute path to a git repository directory | |
| 25 | + |
| 26 | +**Example** |
| 27 | +```javascript |
| 28 | +import readFileString from "read-file-string" |
| 29 | +const result = await readFileString("/my/path") |
| 30 | +result === false |
| 31 | +``` |
| 32 | + |
| 33 | + |
| 34 | +## License |
| 35 | +```text |
| 36 | +MIT License |
| 37 | +
|
| 38 | +Copyright © 2019, Jaid <[email protected]> (github.com/jaid) |
| 39 | +
|
| 40 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 41 | +of this software and associated documentation files (the "Software"), to deal |
| 42 | +in the Software without restriction, including without limitation the rights |
| 43 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 44 | +copies of the Software, and to permit persons to whom the Software is |
| 45 | +furnished to do so, subject to the following conditions: |
| 46 | +
|
| 47 | +The above copyright notice and this permission notice shall be included in all |
| 48 | +copies or substantial portions of the Software. |
| 49 | +
|
| 50 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 51 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 52 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 53 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 54 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 55 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 56 | +SOFTWARE. |
| 57 | +``` |
0 commit comments