title: Is it possible to use the p5.js library in google apps script
body: <p>I'm trying to access the p5.js library from google app script. Below is my the doGet() function I've tried. Am I doing it wrong? Or is this library inaccessible when using apps script?</p>
  
  <pre><code>function doGet() { eval(UrlFetchApp.fetch('https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.14/p5.js', Object).getContentText());
  
  return HtmlService.createHtmlOutputFromFile('index');
  }
  </code></pre>
  
  <p>I've also tried updating the code by removing the Object parameter like this:</p>
  
  <pre><code>    function doGet() {
  eval(UrlFetchApp.fetch('https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.14/p5.js').getContentText());
        return HtmlService.createHtmlOutputFromFile('index');
      }
  </code></pre>
  
  <p>But I still get an error.</p>
  
  <p>SyntaxError: Missing name after . operator.</p>
  
  <p>UPDATE:
  I tried Mario's code from below. It fixed the first error. But now I'm trying to create a canvas, and all I see is a blank page. No errors listed. Here's how the code looks now.</p>
  
  <p>doget.gs</p>
  
  <pre><code>function doGet() {
     var template = HtmlService.createTemplateFromFile("demo");
     return template.evaluate().setSandboxMode(HtmlService.SandboxMode.IFRAME); 
  }
  </code></pre>
  
  <p>sketch.gs</p>
  
  <pre><code>function setup() {
    createCanvas(400,600);
  }
  
  function draw() {
    background(100);
  }
  </code></pre>
  
  <p>demo.html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.14/p5.js"&gt;&lt;/script&gt;
      &lt;script src="sketch.gs"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>