docs: function(filename, props, callback) {
          var pkg = {};
          // Basic values.
          ['name', 'title', 'description', 'version', 'homepage'].forEach(function(prop) {
            if (prop in props) { pkg[prop] = props[prop]; }
          });
          // Author.
          var hasAuthor = Object.keys(props).some(function(prop) {
            return (/^author_/).test(prop);
          });
          if (hasAuthor) {
            pkg.author = {};
            ['name', 'email', 'url'].forEach(function(prop) {
              if (props['author_' + prop]) {
                pkg.author[prop] = props['author_' + prop];
              }
            });
          }
          // Other stuff.
          if ('repository' in props) {
            // Detect whether repository was given as string or object
            if (typeof props.repository === 'string') {
              pkg.repository = {type: 'git', url: props.repository};
            } else {
              pkg.repository = props.repository;
            }
          }
          if ('bugs' in props) { pkg.bugs = {url: props.bugs}; }
          if (props.licenses) {
            pkg.licenses = props.licenses.map(function(license) {
              return {type: license, url: props.homepage + '/blob/master/LICENSE-' + license};
            });
          }
  
          // Node/npm-specific (?)
          if (props.main) { pkg.main = props.main; }
          if (props.bin) { pkg.bin = props.bin; }
          if (props.engines) { pkg.engines = props.engines; }
          else if (props.node_version) { pkg.engines = {node: props.node_version}; }
          if (props.scripts) { pkg.scripts = props.scripts; }
          if (props.npm_test) {
            pkg.scripts = pkg.scripts || {};
            pkg.scripts.test = props.npm_test;
            if (props.npm_test.split(' ')[0] === 'grunt') {
              if (!props.devDependencies) { props.devDependencies = {}; }
              if (!props.devDependencies.grunt) {
                props.devDependencies.grunt = '~' + grunt.version;
              }
            }
          }
  
          if (props.dependencies) { pkg.dependencies = props.dependencies; }
          if (props.devDependencies) { pkg.devDependencies = props.devDependencies; }
          if (props.peerDependencies) { pkg.peerDependencies = props.peerDependencies; }
          if (props.keywords) { pkg.keywords = props.keywords; }
  
          // Allow final tweaks to the pkg object.
          if (callback) { pkg = callback(pkg, props); }
  
          // Write file.
          grunt.verbose.or.write('Writing ' + filename + '...');
          try {
            grunt.file.write(init.destpath(filename), JSON.stringify(pkg, null, 2));
            grunt.verbose.or.ok();
          } catch(e) {
            grunt.verbose.or.error().error(e);
            throw e;
          }
        }