Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 69 lines (45 sloc) 1.97 kB
558c2ac @tj Initial commit
tj authored
1 # Express Messages
2
3 The _express-messages_ module provides flash notification rendering. To use simply assign it to a dynamic helper:
4
5 app.dynamicHelpers({ messages: require('express-messages') });
6
6759b82 @tj docs
tj authored
7 ## Installation
8
7077659 @rxbynerd One char typo, sorry for being pedantic
rxbynerd authored
9 $ npm install express-messages
6759b82 @tj docs
tj authored
10
11 ## Usage
12
fc7f746 @niftylettuce Added documentation for Jade support.
niftylettuce authored
13 Then in a view you may output the notifications based on your templating engine:
14
15 ### [EJS](https://github.com/visionmedia/ejs)
558c2ac @tj Initial commit
tj authored
16
17 <%- messages() %>
18
fc7f746 @niftylettuce Added documentation for Jade support.
niftylettuce authored
19 ### [Jade](http://jade-lang.com/)
20
e26e097 @niftylettuce Normal syntax now working locally, odd error in previous commit
niftylettuce authored
21 != messages()
fc7f746 @niftylettuce Added documentation for Jade support.
niftylettuce authored
22
558c2ac @tj Initial commit
tj authored
23 Which outputs HTML as shown below:
24
25 <div id="messages">
26 <ul class="info">
27 <li>Email queued</li>
28 <li>Email sent</li>
29 </ul>
30 <ul class="error">
31 <li>Email delivery failed</li>
32 </ul>
33 </div>
34
35 ## Running Tests
36
37 First make sure you have the submodules:
38
39 $ git submodule update --init
40
41 Then run the tests:
42
43 $ make test
44
45 ## License
46
47 (The MIT License)
48
49 Copyright (c) 2010 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
50
51 Permission is hereby granted, free of charge, to any person obtaining
52 a copy of this software and associated documentation files (the
53 'Software'), to deal in the Software without restriction, including
54 without limitation the rights to use, copy, modify, merge, publish,
55 distribute, sublicense, and/or sell copies of the Software, and to
56 permit persons to whom the Software is furnished to do so, subject to
57 the following conditions:
58
59 The above copyright notice and this permission notice shall be
60 included in all copies or substantial portions of the Software.
61
62 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
63 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
64 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
65 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
66 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
67 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
68 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Something went wrong with that request. Please try again.