
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
derby-jade
Advanced tools
Jade fork for derby.js templates compilation (not the actual Derby.js template engine).
Supports derby-specific tags that ends with :
and makes if, else, else if, unless, with, each
compile into derby View-variables.
Right after creating your Derby app, add:
// Add Jade compilation support
app.serverUse(module, 'derby-jade');
Make sure this is before any calls to app.loadViews()
.
If you want to use Coffeescript instead of Javascript in templates:
// Add Jade compilation support
app.serverUse(module, 'derby-jade', {coffee: true});
Then you can do something like this:
if a and b
p
a(on-click="console.log c or 'log'") {{d or 'Click Me'}}
each
, with
if _session.loggedIn
h1 Hello, {{_session.username}}
else
a(href='/login') Login
compiles to
{{if _session.loggedIn}}
<h1>Hello, {{_session.username}}</h1>
{{else}}
<a href="/login">Login</a>
{{/}}
Another example:
if _page.flash as #flash
if #flash.error
ul.alert.alert-error
each #flash.error
li {{this.error}}
if #flash.info
ul.alert.alert-success
each #flash.info as #info
li {{#info}}
else
p No notifications
compiles to
{{if _page.flash as #flash}}
{{if #flash.error}}
<ul class="alert alert-error">
{{each #flash.error}}
<li>{{this.error}}</li>
{{/}}
</ul>
{{/}}
{{if #flash.info}}
<ul class="alert alert-success">
{{#each #flash.info as #info}}
<li>{{#info}}</li>
{{/}}
</ul>
{{/}}
{{else}}
<p>No notifications</p>
{{/}}
import:
and template declarationsimport:(src='./auth', ns='')
import:(src='./games')
Title:
| My cool app
Body:
view(name='welcome', title='Welcome {{_session.username}}')
p We are glad to see you!
Footer:
view(name='copyright')
welcome:
h1 {{@title}}
| {{@content}}
copyright:
p Use it however you want {{_session.username}}!
$ cd /path/to/project/
$ npm install git://github.com/cray0000/derby-jade.git --save-dev
Can be used in conjunction with task-runners like grunt-contrib-jade or directly by calling for example:
$ ./node_modules/.bin/jade -w ./jade/ --out ./views/**/
FAQs
Jade for Derby.js
The npm package derby-jade receives a total of 6 weekly downloads. As such, derby-jade popularity was classified as not popular.
We found that derby-jade demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.