You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

JavaScript file manipulation in OIC

edited Jul 20, 2020 9:15PM in Integration 4 comments

Summary

Need to add carriage return/line at the end of the Jason file created through Stage activity

Content

Hi,

I need to add a carriage return/line at the end of the file and the file was created  under staging location (using stage activity). I try to use below java script function by passing the filename to  manipulate  but getting error at line ( const fs = require('fs'); ).

Do I need to import any java script file libraries?.  Please let me know.

function addEOL(filename) {

    const fs = require('fs');

    fs.appendFile(filename, 'data to append', function (err) {
      if (err) throw err;

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!