Maya Docs
  • Introducing Maya
  • Product
    • Command Bar
    • Workspaces
      • Importing JSON Workflows
    • Modules
      • Config Profiles
    • Node Library
      • Common
        • Inject
        • Debug
        • Complete
        • Catch
        • Status
      • Functions
        • Function
        • Change
        • Switch
        • Template
        • Range
        • Delay
        • Trigger
        • Filter
        • Exec
      • Storage
        • Read File
        • Modify File
        • Watch Files
      • Parser
        • CSV
        • HTML
        • JSON
        • XML
        • YAML
      • Sequence
        • Split Into Array
        • Join Array
        • Sort Array
        • Batch Messages
      • Dashboard
        • Button
        • Chart
        • Slider
        • Gauge
        • Switch
        • Dropdown
        • Numeric Input
        • Text Input
        • Template
        • Date Picker
        • Colour Picker
        • Form
        • Display Text
        • Audio Out
      • Network
        • Websockets
          • Websocket Out
          • Websocket In
        • HTTP
          • HTTP In
          • HTTP Response
          • HTTP Request
      • Command Bar
        • Bot Scheduler
        • Bot Command In
        • Bot Command Out
          • Bot Response
          • Bot Web Card
          • Bot Dash Card
        • Custom Search In
        • Custom Search Out
        • Bot Info
      • Spotify
        • Get Playback State
        • Control Playback
        • Play
        • Library
        • Playlist
        • Search
    • Web Extension
      • Selecting Elements
      • Making a web automation skill in 5 minutes
    • Troubleshooting
    • Changelog
  • Tutorials
    • Install skills/modules from store
    • Building fundamentals
    • Connect different services
      • Spotify + Figma
      • Zoom + Google Calendar
    • Browser Automation
      • Control YouTube - Easy
      • Scrape Twitter - Moderate
      • Manage Gmail Inbox - Hard
Powered by GitBook
On this page
  1. Product
  2. Node Library
  3. Storage

Read File

Reads the contents of a file as either a string or binary buffer.

PreviousStorageNextModify File

Last updated 3 years ago

Was this helpful?

CtrlK
  • Inputs
  • Outputs
  • Details

Was this helpful?

Inputs

  • filename (string) : if not set in the node configuration, this property sets the filename to read. The filename should be an absolute path.

Outputs

  • payload (string | buffer) : The contents of the file as either a string or binary buffer.

  • filename (string) : If not configured in the node, this optional property sets the name of the file to be read.

Details

The filename should be an absolute path, otherwise it will be relative to the working directory of the Workspace process.

On Windows, path separators may need to be escaped, for example: \\Users\\myUser.

Optionally, a text file can be split into lines, outputting one message per line, or a binary file split into smaller buffer chunks - the chunk size being operating system dependant, but typically 64k (Linux/Mac) or 41k (Windows).

When split into multiple messages, each message will have a parts property set, forming a complete message sequence.

Encoding of input data can be specified from list of encodings if output format is string.

Errors should be caught and handled using a Catch node.