Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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
The npm package wee-bootstrap receives a total of 1 weekly downloads. As such, wee-bootstrap popularity was classified as not popular.
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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.