<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[What is the difference between require() and getScripts()?]]></title><description><![CDATA[<p dir="auto">I’ve been trying to implement the <em>jquery</em> dependent package (<code>Tabulator</code>) on my mirror. What it does is, convert JSON data into a nice dynamic HTML table.</p>
<p dir="auto">In the working HTML version, I just the <code>script</code> tag, to include everything, but in a Node MMM, we can either use <code>require("blablah")</code> in the <code>node_helper.js</code> file, or use <code>getScripts("blablah.js")</code> in the <code>MMM-MyModule.js</code> file.</p>
<ol>
<li>What is the difference?</li>
<li>When to use what?</li>
</ol>
<p dir="auto">Right now I’m using the 2nd option, and it loads, but the table is never shown… I’m thinking I’m missing something.</p>
]]></description><link>https://forum.magicmirror.builders/topic/6612/what-is-the-difference-between-require-and-getscripts</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 13:06:15 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/6612.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 19 Feb 2018 22:12:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to What is the difference between require() and getScripts()? on Wed, 21 Feb 2018 02:24:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cowboysdude" aria-label="Profile: cowboysdude">@<bdi>cowboysdude</bdi></a></p>
<p dir="auto">Both? ;-)</p>
]]></description><link>https://forum.magicmirror.builders/post/36030</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/36030</guid><dc:creator><![CDATA[Mykle1]]></dc:creator><pubDate>Wed, 21 Feb 2018 02:24:33 GMT</pubDate></item><item><title><![CDATA[Reply to What is the difference between require() and getScripts()? on Wed, 21 Feb 2018 02:19:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mykle1" aria-label="Profile: Mykle1">@<bdi>Mykle1</bdi></a> said in <a href="/post/35989">What is the difference between require() and getScripts()?</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cowboysdude" aria-label="Profile: cowboysdude">@<bdi>cowboysdude</bdi></a> said in <a href="/post/35982">What is the difference between require() and getScripts()?</a>:</p>
<blockquote>
<p dir="auto">I know people don’t usually ask for fear they’ll look ‘not smart’</p>
</blockquote>
<p dir="auto">I don’t have this problem. ;-)</p>
</blockquote>
<p dir="auto">Which one? Asking or not being smart LOL</p>
]]></description><link>https://forum.magicmirror.builders/post/36029</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/36029</guid><dc:creator><![CDATA[cowboysdude]]></dc:creator><pubDate>Wed, 21 Feb 2018 02:19:42 GMT</pubDate></item><item><title><![CDATA[Reply to What is the difference between require() and getScripts()? on Tue, 20 Feb 2018 13:34:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cowboysdude" aria-label="Profile: cowboysdude">@<bdi>cowboysdude</bdi></a> said in <a href="/post/35982">What is the difference between require() and getScripts()?</a>:</p>
<blockquote>
<p dir="auto">I know people don’t usually ask for fear they’ll look ‘not smart’</p>
</blockquote>
<p dir="auto">I don’t have this problem. ;-)</p>
]]></description><link>https://forum.magicmirror.builders/post/35989</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/35989</guid><dc:creator><![CDATA[Mykle1]]></dc:creator><pubDate>Tue, 20 Feb 2018 13:34:54 GMT</pubDate></item><item><title><![CDATA[Reply to What is the difference between require() and getScripts()? on Tue, 20 Feb 2018 11:28:00 GMT]]></title><description><![CDATA[<p dir="auto">Well you really shouldn’t mark this as closed or solved because I’m sure others will have questions too :)</p>
<p dir="auto">It’s a GREAT explanation… and it’s also a GREAT question!!!  I’m sure others have wondered and I know people don’t usually ask for fear they’ll look ‘not smart’…but NO question is a dumb question!!</p>
<p dir="auto">The worst question in history?   The one that never got asked!  :)</p>
]]></description><link>https://forum.magicmirror.builders/post/35982</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/35982</guid><dc:creator><![CDATA[cowboysdude]]></dc:creator><pubDate>Tue, 20 Feb 2018 11:28:00 GMT</pubDate></item><item><title><![CDATA[Reply to What is the difference between require() and getScripts()? on Tue, 20 Feb 2018 10:30:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ninjabreadman" aria-label="Profile: ninjabreadman">@<bdi>ninjabreadman</bdi></a> Aah! Finally. Thank you. That is the most sensible explanation I’ve seen.<br />
(If you’re a moderator, please mark this as closed/solved.)</p>
]]></description><link>https://forum.magicmirror.builders/post/35977</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/35977</guid><dc:creator><![CDATA[E3V3A]]></dc:creator><pubDate>Tue, 20 Feb 2018 10:30:12 GMT</pubDate></item><item><title><![CDATA[Reply to What is the difference between require() and getScripts()? on Tue, 20 Feb 2018 00:59:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/e3v3a" aria-label="Profile: E3V3A">@<bdi>E3V3A</bdi></a></p>
<p dir="auto"><code>require()</code> is for when you mean “I’m going to use this code somewhere else in this script I am writing right now” — i.e. somewhere on the <strong>server-side</strong>.</p>
<p dir="auto"><code>getScripts()</code> is for when you mean “my client-facing/browser code will need this loaded to perform some operation” — i.e. somewhere on the <strong>client-side</strong>.</p>
<p dir="auto"><em>(As always, this is what I understand and hope someone will correct me if I’m wrong.)</em></p>
]]></description><link>https://forum.magicmirror.builders/post/35956</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/35956</guid><dc:creator><![CDATA[ninjabreadman]]></dc:creator><pubDate>Tue, 20 Feb 2018 00:59:18 GMT</pubDate></item></channel></rss>