
Research
/Security News
Contagious Interview Campaign Escalates With 67 Malicious npm Packages and New Malware Loader
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
wee-bootstrap
Advanced tools
Twitter Bootstrap Based HTML Helper for Express
##Requirements
You need only two thing for getting start with wee.
####NPM for Install Open terminal and write below line for installation.
$npm install wee
CSS and JS files for stylesheets.
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
Wee's express integration is realy easy. Integration is very easy like other modules, you only need add one line into your main node file.
For example:
var express = require('express');
var app = express();
var wee = require('wee')(app);
app.set('view engine', 'wee');
app.set('views', __dirname + "/views");
After the module declaration now we can start use helper. Only three type supporting for now:
###Lists
Firstly we declare view render progress;
var myList = {
"items" : [
{"content":"list element 1", "href":"this field optional, will compile when isLink property true", "count":1},
{"content":"list element 2", "href":"this field optional, will compile when isLink property true", "count":2},
{"content":"list element 3", "href":"this field optional, will compile when isLink property true", "count":3}
],
"className":"spesificClassName",
"showCount":true,
"isLink":true
}
app.get('/', function(req, res) {
res.render('index', {myList:myList});
});
Let's prepare our view to render progress:
<!doctype html>
<head>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<div style="margin-top:100px"></div>
<div class="row">
<div class="col-md-4">
// for list type we must write '**list' pre-declaration
**list myList
</div>
</div>
</div>
</body>
</html>
After render progress html result looks like below:
###Table
For tables likes to list's declare again in main app file.
var table = {
items:
[
[
{"content":"ad"},
{"content":"soyad"},
{"content":"no"}
],
[
{"content":"furkan"},
{"content":"başaran"},
{"content":"5"}
],
[
{"content":"fatma"},
{"content":"açar"},
{"content":"6"}
],
[
{"content":"kadir"},
{"content":"yaka"},
{"content":"7"}
],
[
{"content":"doğan"},
{"content":"derya"},
{"content":"8"}
]
],
className: "table-striped"
};
app.get('/', function (req, res) {
res.render('index', {myTable:myTable});
});
<!doctype html>
<head>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<div style="margin-top:100px"></div>
<div class="row">
<div class="col-md-4">
// for list type we must write '**list' pre-declaration
**table myTable
</div>
</div>
</div>
</body>
</html>
After render progress html ouput looks like below
###Form
Declare again in main app file
var form = {
"action":"/register",
"method":"POST",
"fields": [
{"name":"username","type":0,"req":true},
{"name":"email","type":1,"req":true},
{"name":"password","type":2,"req":true}
],
"id_prefix":"item"
}
app.get('/', function(req, res) {
res.render('index', {myForm:myForm});
});
<!doctype html>
<head>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<div style="margin-top:100px"></div>
<div class="row">
<div class="col-md-4">
// for list type we must write '**list' pre-declaration
**form myForm
</div>
</div>
</div>
</body>
</html>
Rendered output looks like below:
If you have an idea or find error please entry issue. Thanks
FAQs
twitter bootstrap based html helper for express
We found that wee-bootstrap 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.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.