I'd like to know what are the steps required to create a framework on top of node.js. I believe this can be a good way to learn, that's why I'm doing this!
I've been checking other micro-frameworks and bigger frameworks but I'm not being able to understand where to start. I'd like your advice on this.
Edit: MVC Framework like Sinatra, Merb, Rails.
What is a JavaScript framework? JavaScript frameworks are the vessels emboldening the language to do its best work with little to no configuration. JavaScript being one of the most popular languages of time past and now, it's a favorite for web development both on the front and back-end.
Vue. js. When I posed the question of which JS framework to learn first—both internally to Skillcrush developers and externally to other JS pros—Vue. js was consistently mentioned as a solid option.
For an MVC framework, the basic concepts go something like this (forgive the simplicity):
var view = 'I say, "{{first}} {{second}}".';
var model = {
first: 'hello',
second: function(){
return 'world';
}
};
for(item in model){
var regex = new RegExp('{{' + item + '}}', 'gi');
if(typeof(item) == 'function')
view = view.replace(regex, model[item]());
else
view = view.replace(regex, model[item]);
}
console.log(view);
Start as simple as possible and add small enhancements:
Take a look at mustache.js for a small template engine. Note their terminology differs from mine in examples and code. What I call a view, they call a template and what I call a model, they call a view. It's a small thing but potentially confusing.
Additional resources:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With