Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including grunt-render with all npm packages installed. Try it out:

var gruntRender = require("grunt-render")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

grunt-render v0.6.5

Grunt tasks initiated on the server side while rendering views

Grunt Render

This library was created with the belief that a server is smarter than just delivering static assets and thus can deal with the necessary build process for compiling and delivering a production-ready web application.

From a workflow perspective, this method alleviates from duplication in the codebase repository and relieves developers from running extraneous building processes on their local machines.

The build process is dead, long live the build.


  • Supports: JS, CSS, LESS
  • Automatically generates markup
  • Optionally outputs js as a require.js config object
  • Compares existing files with modified date and md5 signature


npm install grunt-render


Grunt render uses the same api as the regular grunt tasks, only it executes them on the server side as needed.


You can call the methods directly any time:

var grunt_render = require('grunt-render')

    name : "helpers",
    files : ["/assets/js/helpers/underscore.js", "/assets/js/helpers/handlebars.js"]


  • Using handlebars:
{{#grunt "js" "helpers"}}


In line with JavaScripts, stylesheets can be minified programatically:

    name : "styles",
    files : ["/assets/css/stylesheet1.css", "/assets/css/stylesheet2.css"]

or in a view using a (Handlebars) helper

{{#grunt "css" "styles"}}


With LESS stylesheets, the JavaScript lib is automaically added when the assets are unminified.

Using the aforementioned Handlebars helper, the LESS styles are initiated like this:

{{#grunt "less" "main"}}


  • main : the location of the initializing script

  • cdn : domain of the cdn

  • less : options related to the less minification

  • require : options related to require.js

  • minify : options related with the miinfication process


  • js() : add one or more javascript files

  • css() : add one or more stylesheet files

  • less() : add one or more less files

  • main() : render the final output


Initiated by Makis Tracend ( @tracend )

Distributed through

Released under the MIT license

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free