Package Exports
- read-file-string
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (read-file-string) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
read-file-string
Returns file content as a UTF-8 string. Returns null if file does not exist (or is a directory) instead of throwing an Error.
Installation
npm install --save read-file-string@^1.1.1yarn add read-file-string@^1.1.1
(if configured properly)
npm install --save @jaid/read-file-string@^1.1.1Example
import readFileString from "read-file-string"
readFileString("./existingFile.txt").then(result => {
})
readFileString("./doesNotExist.txt").then(result2 => {
})Variable result will be:
the file contentsVariable result2 will be:
nullDevelopment
Setting up:
git clone git@github.com:jaid/read-file-string.git
cd read-file-string
npm installTesting:
npm run test:devTesting in production environment:
npm run testLicense
MIT License
Copyright © 2021, Jaid <jaid.jsx@gmail.com> (https://github.com/jaid)