Module: fsUtil

This is the fsUtil interface

Methods

(inner) get(filename) → {String}

Reads a file and return its content

Parameters:
Name Type Description
filename String

The name of the file to be retrieved

Returns:
Type
String
Example
const simpleStorageSrc = fsUtil.get("SimpleStorage.sol");
// Returns
// contract SimpleStorage {
//     uint storedData;
//
//     function set(uint x) {
//         storedData = x;
//     }
//
//     function get() returns (uint) {
//         return storedData;
//     }
// }

(inner) getJson(filename, options) → {String}

Reads a JSON file and return its content

Parameters:
Name Type Description
filename String

The name of the json file to be retrieved

options *
Returns:
Type
String
Example
const result = fsUtil.getYaml("test.json");
// Returns
// { test: 'testing json' }

(inner) getYaml(filename) → {String}

Reads a yaml file and return its content

Parameters:
Name Type Description
filename String

The name of the yaml file to be retrieved

Returns:
Type
String
Example
const result = fsUtil.getYaml("config.yaml");
// Returns
// { apiDebug: false,
//  timeout: 600000,
//  nodes:
//   [ { id: 0,
//       url: 'http://localhost',
//       publicKey:
//        'publickey',
//       port: 30303,
//       oauth: [Object] } ] }