Filesystem.readSync()

Read a file on disk as a string.

Assumes file contents are encoded using utf8. This machine should **NEVER** be used in request handling code!

Usage

Hover over inputs/exits for more info.

var Filesystem = require('machinepack-fs');


// Read a file on disk as a string.

Filesystem.readSync({

source: '/Users/mikermcneil/.tmp/foo',

}).execSync();

Inputs

source required

Absolute path to the source file (if relative path is provided, will resolve path from current working directory)

'/Users/mikermcneil/.tmp/foo'

Exits

error

An unexpected error occurred.

doesNotExist

No file exists at the provided `source` path

success

OK.

'stuff in a file!'