Hello,
I’m creating a custom plugin and want to access the system resources like filesystem and shell within my plugin code.
I already discovered the appropriate node.js plugins for that task.
My issue is that the require(‘fs’) returns an empty object. For example:
'use strict';
var assign = Object.assign;
function ClientPlugin(eventBus, canvas) {
// this variable is empty. Has no functions in it.
var fileSystem = require('fs');
}
ClientPlugin.$inject = [ 'eventBus', 'canvas' ];
module.exports = {
__init__: [ 'clientPlugin' ],
clientPlugin: [ 'type', ClientPlugin ]
};
Am I doing it wrong? Is there some trick to obtain the right object?
Thank you for your advice.