Node Package - Is it possible to interpolate a variable in package.json?
<p>I have a static site that compile Sass using <code>node-sass</code>.</p>

<p>Currently I'm using Grunt to watch the file, but I feel it's overkill because I can use their built-in CLI.</p>

<p>So I add this in my package.json:</p>

<pre><code>// package.json
...
"scripts": {
  "sass": "node-sass -w input/dir -o output-dir/" 
}
</code></pre>

<p>The problem is, I need to <code>require</code> a Sass framework module (installed globally) in the <code>--include-path</code>. I can do this in Gruntfile:</p>

<pre><code>// Gruntfile.js
sass: {
  options: {
    includePaths: require("the-framework").includePaths()
  },
  ...
},
</code></pre>

<p>So the first thing that come to my mind is to interpolate the string like:</p>

<pre><code>// package.json
...
"scripts": {
  "sass": "node-sass -w input/dir -o output-dir/ --include-path " + require("the-framework").includePaths()
}
</code></pre>

<p>And as expected, it doesn't work. Well the script runs, but the interpolated variable is ignored.</p>

<p>Any solution or alternative? If possible, I would prefer <strong>not to create additional file</strong> just to store the variable.</p>

<p>Thanks</p>