Generates nodified-AngularJS files for your browserified-ready application

Usage no npm install needed!

<script type="module">
  import gruntNgexports from '';



Generates nodified-AngularJS files for your browserified-ready application

Getting Started

This plugin requires Grunt.

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-ngexports --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:



A Grunt plugin I wrote so that I could learn some Grunt. Save some key strokes. Add a bit of opinionation on folder structure. Use this in conjunction with browserify and go from this:

angular.module('app', ['ui.router', 'indexController', 'gabeService']);

angular.module('indexController', [])
.controller('IndexCtrl', function ($scope, gabe) {
  $ =;

angular.module('gabeService', [])
.service('gabe', function () { = 'Gabe!';

to this!

// main.js
var ngExports = require('./ngExports')
ngExports('app', [require('ui.router')]);

// /controllers/index.js
exports.IndexCtrl = function ($scope, gabe) {
  $ =;

// /services/gabe.js
exports.gabe = function () { = 'Gabe!';

Module declaration be gone! The module names for each component are the relative file names. For example, the module for IndexCtrl is then controllers/index.js. This makes isolated unit testing easy to setup (though the module names now become coupled to their folder location).


  ngExports: {
    options: {
      cwd: 'public/scripts'
    files: {
      'public/scripts/ngExports.js': ['public/scripts/**/*.js', '!public/scripts/main.js'],


Copyright (c) 2014 Gabe Scholz. Licensed under the MIT license.