transforming a script into a function

● ARCHIVED · READ-ONLY
Started by JesusGames 2 posts View original ↗
  1. hello to all I have this script but I can not insert it into a plugin with a function as a fix?

    This is code:
    Code:
    const path = require ('path');
    const base = path.dirname (process.mainModule.filename);
    const fs = require ('fs');
    const fileText = "Prima riga \ nLa seconda riga";
    fs.writeFileSync (base + '/test.txt', fileText);
  2. [mod]Closing this as it is a suplicate thread.[/mod]