Docs
IntroductionQuickstart

Guides

Workflow anatomyTemplating languageControl flowInference

Go further

CompositionLifecycleCookbookBrowser extension
Components
App
app:fieldapp:field:createapp:field:deleteapp:field:updateapp:fieldsapp:file:saveapp:recordapp:record:deleteapp:record:historyapp:record:insertapp:record:updateapp:records:queryapp:schemaapp:schema:createapp:schema:create:manyapp:schema:deleteapp:schema:updateapp:schemasapp:tableapp:table:createapp:table:deleteapp:table:updateapp:tables
CSV
csv:mergecsv:shrinkcsv:unchunk
Dir
dir:readdir:write
Each
each
Error
error
Event
event:emit
Exec
exec
File
file:copyfile:findfile:json:unchunkfile:readfile:write
Group
group
HTTP
http
Inference
inferenceinference:estimateinference:models
Map
map
Print
print
Sleep
sleep
Template
template
Var
var
XML
xml
Docs/Workflows/Components/File/file:read

file:read

Reads the full contents of a file and returns it as both a string and raw bytes

Options

NameTypeDescription
pathstringPath to the file to read; relative paths are resolved from the pipeline cwd

Outputs

NameTypeDescription
contentstringFile contents as a UTF-8 string
body[]byteFile contents as raw bytes

Example

name: Read a config file
actions:
  - name: config
    component: file:read
    vars:
      path: ./config.json

outputs:
  config: "{{ config.body | from:'json' }}"
Edit or read the source on GitHub
Previousfile:json:unchunkNext file:write

Built with in Vilnius, Lithuania Say hello!

ProductsOpen sourceDocs GitHub