Learn Node.js
Welcome to the Practical Node.js!
If we want to output a value of a variable (called locals), we use =. For example: p= msg For this example, create index.jade in the views folder that outputs a header and a paragraph with the value of msg variable inside that paragraph (i.e., inner text): h1 hello p= msg There are more advanced examples of Jade included later in this book; but for now, everything is set for the first demo!The only book most people will ever need.
The Comprehensive Book on Express.js
webapplog: where code lives
contact usNode.js is a non-blocking I/O for scalable apps.
0. php
1. node
2. ruby
php: -1
node: 2
ruby: 1
express |
hapi |
derby |
backbone |
angular |
ember |
email body
{{body}}
with data: { title: "Express.js Guide", body: "The Comprehensive Book on Express.js" } renders:The Comprehensive Book on Express.js
{{@index}}. {{this}}
{{/each}}0. php
1. node
2. ruby
{{name}}
{{#with contact}} Twitter: @{{twitter}} {{/with}} Address: {{address.city}}, {{/with}} {{user.address.state}} Then we merge the template with this data. Notice the properties’ names are the same as in the Handlebar template, there’s only one reference to the user object: {user: { contact: { email: '[email protected]', twitter: 'azat_co' }, address: { city: 'San Francisco', state: 'California' }, name: 'Azat' }}Azat
Twitter: @azat_co Address: San Francisco, CaliforniaNode.js is a non-blocking I/O for scalable apps.
{{! @todo change this to a class}} {{!-- add the example on {{#if}} --}} outputsNode.js is a non-blocking I/O for scalable apps.
' + data[i][key] + ' | '; }; str += '
express | http://expressjs.com/ |
hapi | http://spumko.github.io/ |
compound | http://compoundjs.com/ |
derby | http://derbyjs.com/ |
{{body}}
email body