![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Ultra-extendable Mustache-ish template engine on steroids in 846 gzipped kilobytes
Jade-ish + Mustache-ish template engine on steroids in 846 gzipped kilobytes
$ npm install brown
or in the browser:
<script type='text/javascript' src='brown.min.js'></script>
brown.render( "hello {{foo}}", { foo: "world" } );
outputs:
hello world
Create a fullfledged template engine by adding functions:
brown.micromustache.encode = function(key) {
var html = this[key] || '';
return String(html).replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, ''').replace(/</g, '<').replace(/>/g, '>');
};
json = {
div:
'a href="{{href}}" onclick="{{encode:label}}"': "{{label}}"
};
brown.render( json, {href="/", label:"my \"label\""} )
outputs:
<div>
<ul>
<li>
<a href="/" onclick="my "label"">my "label"</a>
</li>
</ul>
</div>
Need more? See if/foreach/filter/etc examples here on how to extend brown with micromustache functions.
ϐrown can be monkeypatched, to automatically produce xml-trees from json (like JADE):
var json = {
ul: {
li: {
'a href="{{foo}}": "Click me"
}
}
}
brown.render json,{ foo: "/" }
outputs:
<ul>
<li>
<a href="/">Click me </a>
</li>
</ul>
How? Simple, by just monkeypatching ϐrown with json-dsl. See coffeescript / JS examples.
Use as a commandline generator (install using npm install -g
) :
$ brown
Usage: brown <string|jsonstring|jsonfile> [jsonstring|jsonfile]
examples:
$ brown 'foo {{foo}}' '{"foo":"world"}'
$ brown html.json data.json
$ brown html.json '{"foo":"world"}'
With these basics you can literally do anything.
Need more? See more examples here on how to extend brown with micromustache functions.
FAQs
Ultra-extendable Mustache-ish template engine on steroids in 620 gzipped kilobytes, need nothing more!
The npm package brown receives a total of 4 weekly downloads. As such, brown popularity was classified as not popular.
We found that brown 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.