
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
express-scaffold-mvc-generator
Advanced tools
$ npm install express-scaffold-mvc-generator -g --save && npm link
$ express prj
$ cd prj
$ npm install
$ express:scaffold install
$ express:scaffold [options] <resource>
For example:
$ express:scaffold posts
invoke routes/routes.js
invoke controllers/posts.js
invoke models/posts.js
invoke views/posts/index.ejs
invoke views/posts/new.ejs
invoke views/posts/show.ejs
invoke views/posts/edit.ejs
invoke views/posts/_form.ejs
invoke views/posts/components/item.ejs
e.g. $ express:scaffold posts
[Router] routes/routes.js
const posts_controller = require('../controllers/posts');
router.get('/posts', posts_controller.index);
router.get('/posts/new', posts_controller.new);
router.get('/posts/:id', posts_controller.show);
router.post('/posts', posts_controller.create);
router.get('/posts/:id/edit', posts_controller.edit);
router.post('/posts/:id', posts_controller.update);
router.post('/posts/:id/delete', posts_controller.delete);
[Model] models/posts.js
let Model = require('../core/model');
class posts extends Model {
constructor(){
super()
}
}
module.exports = [ Model, posts ]
[Controller] controllers/posts.js
let [Controller, render, __] = require('../core/controller');
let [Model, posts] = require('../models/posts');
class PostsController extends Controller {
constructor() { super(__filename) }
// GET /posts.html
// GET /posts.json
index(req, res) {
// 다음과 같이 double underscore 를 사용해,
// 변수를 view 로 전송할 수 있습니다. (변수를 랜더링 스코프에서 유지시킵니다.)
__.title = __.klass.controllers_name;
// 다음과 같이 __.klass 를 통해 멤버 함수를 호출할 수 있습니다.
// (__.klass 는 이 class 에서 할당된 this 를 가리키도록 되어있습니다.)
// __.params = __.klass.posts_params(req);
render(`${__.klass.resource_name}/index`, req, res, __)
}
// GET /posts/new.html
new(req, res) {
render(`${__.klass.resource_name}/new`, req, res, __)
}
// GET /posts/1.html
// GET /posts/1.json
show(req, res) {
render(`${__.klass.resource_name}/show`, req, res, __)
}
// POST /posts.html
// POST /posts.json
create(req, res) {
// render(`${__.klass.resource_name}/show`, req, res, __)
}
// GET /posts/1/edit.html
edit(req, res) {
render(`${__.klass.resource_name}/edit`, req, res, __)
}
// POST /posts/1.html
// POST /posts/1.json
update(req, res) {
// render(`${__.klass.resource_name}/edit`, req, res, __)
}
// POST /posts/1/delete.html
// POST /posts/1/delete.json
delete(req, res) {
// render(`${__.klass.resource_name}/edit`, req, res, __)
}
// @private
posts_params(req) {
return req.params
}
}
let controller = new PostsController();
module.exports = controller.exports(__);
[View] views/posts/ : empty contents ejs filetree
is already given to your project!
Check inside of your core/
directory.
CAUTION
If the core/
directory exists already, the generator will not work for making a new core directory.
routes/routes.js
, you will need to run the script twice to create it normally.
// DO NOT DELETE COMMENTS!!
var express = require('express');
var router = express.Router();
// Require controller modules
...inserted code here...
module.exports = router
$ express:scaffold -h
Contribute and Pull-Request and Proposal are always welcome.
You can always contact me on Email yhkks1038@gmail.com or Create Issue on this Repository.
The MIT License (MIT)
Copyright (c) 2018 Yonghyun Kim (freddy-kim in npm)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Express scaffold MVC generator
The npm package express-scaffold-mvc-generator receives a total of 31 weekly downloads. As such, express-scaffold-mvc-generator popularity was classified as not popular.
We found that express-scaffold-mvc-generator 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.