
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Node module to build quickly api, views to display models, easy integration with Backbone, etc.
FastCrud is Node.js module that makes development of CRUD operations faster, allowing to focus on frontend.
It works with Express and Mongoose.
Some features:
you can define a model simply by its default values. It creates automatically from them the corresponding mongoose Schema
you can add API for defined models simply in one line of code. It generates automatically urls and corresponding methods
you can use generic views to automatically generate urls and corresponding http request handlers and focus only on template to display, modify and create models, with just few lines of code. Generic views supported are: ListView (to list instances of a model), DetailsView (to display single model), CreateView and UpdateView
Suppose you have a Student model with nested School model.
Define a model calling FastCrud.Model function and passing an object of default values.
var FastCrud=require('./fastcrud')
var StudentModel=FastCrud.Model({
Student:{
name: 'Giovanni Johnson',
age: 18,
School: {
name: 'Standford',
address: 'Stand street'
}
},
})
You can invoke FastCrud.get(name_of_model) function to get mongoose model. Example:
var Student=FastCrud.get('Student')
, School=FastCrud.get('School')
var school=new School({
name: 'Roma 3',
address: 'via della Vasca Navale'
})
var student=new Student({
name: 'Marco DiLillo',
age: 24,
school: school
}).save(function(err,doc){
console.log(err,doc);
})
Use setAPI(app) of a defined model, it automatically defines url and corresponding methods to handle instances via GET, PUT, POST, DELETE http methods.
StudentModel.setAPI(app)
Generated urls are:
Use setGenericViews(app,options) to quickly define urls and corresponding routes to display models. It automatically generate corresponding urls, like:
Parameters are:
Example:
StudentModel.setGenericViews(app,{
ListView: {
template: './students/students.jade'
},
DetailsView:{
template: './students/student.jade'
}
})
Example of jade templates for ListView:
- for student in models
p
a(href='/student/#{student._id}/') #{student.name}
Example of jade templates for DetailsView:
p Name: #{model.name}
p School: #{model.school[0].name}
FAQs
Node module to build quickly api, views to display models, easy integration with Backbone, etc.
The npm package fastcrud receives a total of 3 weekly downloads. As such, fastcrud popularity was classified as not popular.
We found that fastcrud 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.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.