node.js – 如何在新的Grunt 0.4中编写助手

在较旧的grund版本中,我执行如下的帮助:

module.exports = function (grunt) {
   grunt.registerMultiTask('taskname',"Grunt task example",function () {
      var result = grunt.helper('helpername',options,data);

      ...
   });

   grunt.registerHelper('helpername',function (options,data) {
      return data;
   });
};

我应该如何在新的Grunt 0.4版本中执行帮助?

解决方法

Upgrading from 0.3 to 0.4页面

Helpers

Grunt’s helper system has been removed in favor of node require. For a concise example on how to share functionality between Grunt plugins,please see 07001. Plugin authors are encouraged to upgrade their plugins.

相关文章

这篇文章主要介绍“基于nodejs的ssh2怎么实现自动化部署”的...
本文小编为大家详细介绍“nodejs怎么实现目录不存在自动创建...
这篇“如何把nodejs数据传到前端”文章的知识点大部分人都不...
本文小编为大家详细介绍“nodejs如何实现定时删除文件”,内...
这篇文章主要讲解了“nodejs安装模块卡住不动怎么解决”,文...
今天小编给大家分享一下如何检测nodejs有没有安装成功的相关...