Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
grunt-embrace
Advanced tools
Template adapter to render and compile Mustache, Handlebars, Dust and Swig templates
Embrace is an adapter that provides a standalone api for rendering and compiling templates. An additional grunt task is also exposed.
Embrace helps compile and render templates, with or without a data context, register partials, and copy browser side libraries in to place.
Mustache is a mature and robust template language. Its simple syntax and logic-less nature is perfect for short tasks.
As an extension of mustache, it provides a bit more, but maintains the syntax.
right now, Dust is unusable in modern versions of Node because this line throws
Error: require.paths is removed. Use node_modules folders, or the NODE_PATH environment variable instead
the related issue is a whole year old now but linkedin picked up the project and their fork seems to be even better and improved than the original
Swig is a powerful template language with a lot of features that are really useful, but hard to find in other engines. Such as template inharitance.
Doc coming soon.. until then, the source is commented where it's applicable.
Type: String
Default: ""
A directory path where to copy the client side embrace script.
Type: String
Default: ""
A directory path where to copy the dust client side library.
Type: Boolean
Default: true
Render files with the given context.
Type: Boolean
Default: false
Precompile files into javascript.
Type: String
Default: ""
A globbing pattern that collects *.json
files.
These will be merged into a global context and will be passed to each template. The file names will be used for root field names.
Type: String
Default: ""
The path part that will be ignored when looking up partials.
If you match partials "nested/folder/partials/*.mustache"
you would have to refer partials in your templates with their full path: {{>nested/folder/partials/apartial}}
With this option, you can set a path part that will be excluded from partial resolution.
E.g. partialsRoot: "nested/folder/partials/"
. Now you can just refer to templates as {{>apartial}}
Type: String
Default: ""
A globbing pattern that collects template files.
The pattern is relative to the resolve
options.
Include/import/partial paths will be looked among these files.
Type: Boolean
Default: false
Embrace loads template files once and returns the same content every time it is requested if this option is true. False by default, because the main reason of this module is to use it with a watch task.
Type: Function
Default: null
A function receiving the template adapter and the embrace object setup(Adapter adapter, Object embrace)
grunt.initConfig({
embrace: {
options: {
client: "test/embrace/",
data: "test/data/*.json",
resolve: "test/partials/",
partials: "**/*.dust",
cache: false,
dust: {
helpers: "",
client: "test/embrace/"
},
setup: function( adapter, embrace ){}
},
compileDust: {
options: {compile: true},
expand: true,
cwd: "test/",
src: ["**/*.dust"],
dest: "test/compiled/",
ext: ".js"
},
compileAndConcatDust: {
options: {
compile: true,
concat: true
},
files: {
"test/compiled/partials.dust.js": "test/partials/**/*.dust",
"test/compiled/templates.dust.js": "test/templates/**/*.dust"
}
}
}
})
grunt.initConfig({
embrace: {
options: {
client: "test/embrace/",
data: "test/data/*.json",
helpers: "test/helpers/dust/*.js",
resolve: "test/partials/",
partials: "**/*.dust",
dust: {
helpers: "",
client: "test/embrace/"
},
setup: function( adapter, embrace ){}
}
renderDust: {
options: {render: true},
expand: true,
cwd: "test/templates",
src: ["*.dust"],
dest: "test/rendered/"
}
}
})
MIT
FAQs
Template adapter to render and compile Mustache, Handlebars, Dust and Swig templates
We found that grunt-embrace demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.