{"_id":"grunt-dustjs-linkedin","_rev":"26-26e0243a0c1b0309875895e54896cd7e","name":"grunt-dustjs-linkedin","time":{"modified":"2022-06-18T14:54:23.524Z","created":"2014-03-09T22:03:31.837Z","0.1.0":"2014-03-09T22:03:31.837Z","0.1.1":"2014-03-09T22:11:35.544Z","0.2.0":"2014-03-17T03:55:53.807Z","0.3.0":"2014-03-19T16:39:55.085Z","0.4.0":"2014-03-24T00:38:09.312Z","0.4.1":"2014-03-24T17:09:34.604Z","0.5.0":"2014-05-03T20:17:16.822Z","0.5.1":"2014-11-05T02:18:46.397Z","0.6.0":"2015-01-18T22:14:35.701Z","0.6.1":"2015-01-18T22:21:26.372Z","0.6.2":"2015-03-28T19:09:54.850Z","0.6.3":"2015-05-02T14:58:00.889Z"},"maintainers":[{"name":"coryroloff","email":"cory@brothersroloff.com"}],"dist-tags":{"latest":"0.6.3"},"description":"Compile DUST files to JS.","readme":"grunt-dustjs-linkedin [![Build Status](https://travis-ci.org/coryroloff/grunt-dustjs-linkedin.png?branch=master)](https://travis-ci.org/coryroloff/grunt-dustjs-linkedin)\n=====================\n\n> Compile DUST files to JS.\n\n\n\n## Getting Started\nThis plugin requires Grunt `~0.4.0`\n\nIf you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:\n\n```shell\nnpm install grunt-dustjs-linkedin --save-dev\n```\n\nInstall dustjs-linkedin and dustjs-helpers as dependencies of your project if you need to lock to a specific version.\n\n```shell\nnpm install --save dustjs-linkedin dustjs-helpers\n```\n\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-dustjs-linkedin');\n```\n\n*This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that [you upgrade](http://gruntjs.com/upgrading-from-0.3-to-0.4).*\n\n\n## Dust task\n_Run this task with the `grunt dust` command._\n\nTask targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide.\n### Options\n\n#### name\nType: `String|Function`\n\nSpecifies the name to be used for the compiled dust template's register function. Defaults to using the destination path with no extension. If a function is provided, then the arguments: data and options will be provided. Data will contain `file`. Options are a copy of the options given to the task.\n\n#### resolve\nType: `Boolean|Function`\n\nResolves a module path based on a template name. Resolve is used to resolve templates included via the partial feature in DustJS. Defaults to using the default name function to resolve partial templates. If a function is provided, then the arguments: data and options will be provided. Data will contain `file`. Options are a copy of the options given to the task. Returning false will tell the task to ignore that partial.\n\n#### optimizers\nType: `Object`\n\nDefault: `{}`\n\nSpecifies custom optimizers to configure the dust compiler with.\n\n#### wrapper\nType: `Boolean|String|Function`\n\nDefault: `false`\n\nSpecifies if and how to wrap the compiled dust template. Allowed values: `amd` and `commonjs`. If you provide a function, then the arguments: data and options will be provided. Data will contain `file`, `name`, `helper`, `compiled` and `dependencies`. Options are a copy of the options given to the task. The string you return will be used as the final compiled output.\n\n#### helper\nType: `Boolean|String|Function`\n\nDefault: `false`\n\nSpecifies if and what exports to use for the wrapper. Allowed values: `dust`, `q` and `bluebird`. If you provide a function, then the arguments: data and options will be provided. Data will contain `file`, `name`, `compiled` and `dependencies`. The string you return will be used inside the wrapper. The dust helper will return exports with the methods `render` and `renderSync`.\n\n#### dependencies\nType: `Object`\n\nDefault: `{}`\n\nSpecifies dependencies to include in the wrapper. Keys are used as the variable names and values are used as the paths for requiring.\n\n#### banner\nType: `String`\n\nDefault: empty string\n\nSpecifies a string that will be prepended to the compiled output. Template strings (e.g. <%= config.value %> will be expanded automatically.\n\n#### footer\nType: `String`\n\nDefault: empty string\n\nSpecifies a string that will be appended to the compiled output. Template strings (e.g. <%= config.value %> will be expanded automatically.\n\n### Usage Examples\n\n**Basic Grunt configuration**\n```js\ndust: {\n  options: {\n    wrapper: \"amd\",\n    helper: \"dust\",\n    dependencies: {\n      dust: \"dust\"\n    },\n    optimizers: {\n      format: function(ctx, node) { return node; }\n    }\n  },\n  build: {\n    expand: true,\n    cwd: \"src\",\n    src: \"**/*.dust\",\n    dest: \"dist\",\n    ext: \".js\",\n    filter: \"isFile\"\n  }\n}\n```\n\n**Rendering a template with the AMD wrapper and the Dust helper**\n```js\ndefine([\"./templates/my-template\"], function(MyTemplate) {\n  MyTemplate.render({key: \"value\"}, function(error, output) {\n\n  });\n\n  try {\n    var output = MyTemplate.renderSync({key: \"value\"});\n  }\n  catch(error) {\n\n  }\n});\n```\n\n**Rendering a template with the CommonJS wrapper and the Q helper**\n```js\nvar MyTemplate = require(\"./templates/my-template\");\n\nMyTemplate.render({key: \"value\"})\n.then(function(output) {\n\n})\n.catch(function(error) {\n\n})\n.done();\n\nQ.fcall(MyTemplate.renderSync, {key: \"value\"})\n.then(function(output) {\n\n})\n.catch(function(error) {\n\n})\n.done();\n```\n\n## RequireJS Plugin\n\nA plugin for RequireJS is included for compiling Dust templates into the same format as the AMD wrapper. Note: The following dependencies are required: dust-full (dustjs-linkedin), text (requirejs) and optionally, q.\n\n### Options\n\n#### url\nType: `String`\n\nDefault: empty string\n\nSpecifies a URL to prepend to the template's module path before requiring.\n\n#### ext\nType: `String`\n\nDefault: `.dust`\n\nSpecifies the extension used for your Dust templates.\n\n#### helper\nType: `Boolean|String|Function`\n\nDefault: `false`\n\nSpecifies if and what exports to use for the wrapper. Allowed values: `dust`, `q` and `bluebird`. If you provide a function, then the arguments: name will be provided. The object you return will be used inside the wrapper. The dust helper will return exports with the methods `render` and `renderSync`.\n\n#### name\nType: `Function`\n\nSpecifies the name to be used for the compiled dust template's register function. Defaults to using the destination path with no extension. If a function is provided, then the arguments: name will be provided.\n\n#### resolve\nType: `Boolean|Function`\n\nResolves a module path based on a template name. Resolve is used to resolve templates included via the partial feature in DustJS. Defaults to using the default name function to resolve partial templates. If a function is provided, then the arguments: name will be provided. Returning false will tell the task to ignore that partial.\n\n### Usage Examples\n\n**Basic Require configuration**\n```js\nrequire.config({\n  config: {\n    dustc: {\n      url: '',\n      ext: '.dust',\n      helper: 'dust'\n    }\n  }\n});\n```\n\n**Rendering a template with the AMD wrapper and the Dust helper**\n```js\ndefine([\"dustc!./templates/my-template\"], function(MyTemplate) {\n  MyTemplate.render({key: \"value\"}, function(error, output) {\n\n  });\n\n  try {\n    var output = MyTemplate.renderSync({key: \"value\"});\n  }\n  catch(error) {\n\n  }\n});\n```\n","versions":{"0.6.2":{"name":"grunt-dustjs-linkedin","version":"0.6.2","description":"Compile DUST files to JS.","scripts":{"test":"grunt test"},"author":{"name":"Cory Roloff","url":"http://coryroloff.com"},"repository":{"type":"git","url":"git@github.com:coryroloff/grunt-dustjs-linkedin.git"},"license":{"name":"MIT","url":"https://github.com/coryroloff/grunt-dustjs-linkedin/blob/master/LICENSE"},"devDependencies":{"dustjs-helpers":"^1.5.0","dustjs-linkedin":"^2.5.1","grunt":"^0.4.2","grunt-cli":"^0.1.13","grunt-contrib-clean":"^0.5.0","grunt-contrib-jshint":"^0.8.0","grunt-contrib-nodeunit":"^0.3.2"},"peerDependencies":{"grunt":"^0.4.2","dustjs-helpers":"*","dustjs-linkedin":"*"},"dependencies":{"lodash":"^2.4.1"},"engines":{"node":">= 0.10.0"},"keywords":["grunt","gruntplugin","dust","linkedin","q","bluebird","requirejs","commonjs","amd"],"files":["tasks","dustc.js","LICENSE"],"gitHead":"acb4c9f2914b224ea3d4291b2509e28864f52e4c","bugs":{"url":"https://github.com/coryroloff/grunt-dustjs-linkedin/issues"},"homepage":"https://github.com/coryroloff/grunt-dustjs-linkedin","_id":"grunt-dustjs-linkedin@0.6.2","_shasum":"b79524486206cd6b3ab7ada6c370c1f8e683919c","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"coryroloff","email":"cory@brothersroloff.com"},"maintainers":[{"name":"coryroloff","email":"cory@brothersroloff.com"}],"dist":{"shasum":"b79524486206cd6b3ab7ada6c370c1f8e683919c","tarball":"https://registry.npmjs.org/grunt-dustjs-linkedin/-/grunt-dustjs-linkedin-0.6.2.tgz","integrity":"sha512-A052xHLvWNkIkMDgfi12PJFlfwMKboAWwKF1XkrXQQ7kBDr7P664Ax7ZkwOp5oXelzoI8Glmbu43ozKQ6QU7Dw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpi1yQpCPH5uxrmCkLp7sqmi019+fL1bGSVVDrRXuZAwIhAOKMlMbpe55iY2WSqXo+mO2Y02LE3Giw/Y4s2uBSMxmc"}]}},"0.6.3":{"name":"grunt-dustjs-linkedin","version":"0.6.3","description":"Compile DUST files to JS.","scripts":{"test":"grunt test"},"author":{"name":"Cory Roloff","url":"http://coryroloff.com"},"repository":{"type":"git","url":"git+ssh://git@github.com/coryroloff/grunt-dustjs-linkedin.git"},"license":{"name":"MIT","url":"https://github.com/coryroloff/grunt-dustjs-linkedin/blob/master/LICENSE"},"devDependencies":{"dustjs-helpers":"^1.7.0","dustjs-linkedin":"^2.7.0","grunt":"^0.4.5","grunt-contrib-clean":"^0.6.0","grunt-contrib-jshint":"^0.11.2","grunt-contrib-nodeunit":"^0.4.1"},"peerDependencies":{"grunt":"*","dustjs-helpers":"*","dustjs-linkedin":"*"},"dependencies":{"lodash":"^3.7.0","bluebird":"*","q":"*"},"engines":{"node":">= 0.10.0"},"keywords":["grunt","gruntplugin","dust","linkedin","q","bluebird","requirejs","commonjs","amd"],"files":["tasks","dustc.js","LICENSE"],"optionalDependencies":{"bluebird":"*","q":"*"},"gitHead":"a641f6f72067b15fb96fe8942f49b40ce209188d","bugs":{"url":"https://github.com/coryroloff/grunt-dustjs-linkedin/issues"},"homepage":"https://github.com/coryroloff/grunt-dustjs-linkedin#readme","_id":"grunt-dustjs-linkedin@0.6.3","_shasum":"6edf72821adb5726cb0f7648cd88ebfa118f050e","_from":".","_npmVersion":"2.8.3","_nodeVersion":"0.12.2","_npmUser":{"name":"coryroloff","email":"cory@brothersroloff.com"},"maintainers":[{"name":"coryroloff","email":"cory@brothersroloff.com"}],"dist":{"shasum":"6edf72821adb5726cb0f7648cd88ebfa118f050e","tarball":"https://registry.npmjs.org/grunt-dustjs-linkedin/-/grunt-dustjs-linkedin-0.6.3.tgz","integrity":"sha512-pTn/QNZ+CtOegotLWrBErLxMcjb55twIu3MzrlihKUrrrgLXAtfqVu/NScwdID5fI4KJs3D0JyRLVnA0SrifsQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDA5bWDGK+WquTw1acdvLmRCZfyf+dDm8uKIii3p6hE7wIgD16qV+tj6vmtf7jWmG02Gq5xeIMl1kKmRaKraHjpkMI="}]}}},"homepage":"https://github.com/coryroloff/grunt-dustjs-linkedin#readme","keywords":["grunt","gruntplugin","dust","linkedin","q","bluebird","requirejs","commonjs","amd"],"repository":{"type":"git","url":"git+ssh://git@github.com/coryroloff/grunt-dustjs-linkedin.git"},"author":{"name":"Cory Roloff","url":"http://coryroloff.com"},"bugs":{"url":"https://github.com/coryroloff/grunt-dustjs-linkedin/issues"},"license":{"name":"MIT","url":"https://github.com/coryroloff/grunt-dustjs-linkedin/blob/master/LICENSE"},"readmeFilename":"README.md"}