query
On this page

fileContents

lib.fileContents

Docs pulled from | This Revision | about 1 hour ago


Read the contents of a file removing the trailing \n

Inputs

file
1. Function argument

Type

fileContents :: path -> string

Examples

lib.strings.fileContents usage example

$ echo "1.0" > ./version

fileContents ./version
=> "1.0"
(lib.strings.fileContents)

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

fileContents = file: removeSuffix "\n" (readFile file);