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.
Creates CRUD RESTfull endpoints for a given route.
npm install crude --save
Crude requires a controller with the following methods and signatures:
var crude = require('crude');
var controller = {
create: function(data) { return Promise(response); }),
read: function(query) { return Promise(response); }),
readLimit: function(query, skip, limit) { return Promise(response); }),
readOne: function(query) { return Promise(response); }),
update: function(query, data) { return Promise(response); }),
count: function(query) { return Promise(response); }),
};
// Create the user CRUD routes
var userCrude = crude('/user', controller, expressApp);
That was it, you now have a RESTfull CRUD API under the route /user
:
/user
Create a new user./user
Get a list of all the users paginated./user/:id
Get a single user item./user/:id
Update the user item, expects the entirety of the resource to be updated./user/:id
Update the user item, expects a part of the resource to be updated./user/:id
Delete the user item.HTTP methods were mapped based on RFC7231 Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content: HTTP Method Definitions.
Find the complete API Documentation in the wiki.
This package assumes you have the following stack:
PUT
and PATCH
, thank you @dmtrs.readLimit
OP result is an array.opts.paginateLimit
.req.host
to req.hostname
in par with express 4.xpage
and limit
query variables.View the rest of the changelog here.
Copyright 2014 Thanasis Polychronakis
Licensed under the MIT License
FAQs
Creates CRUD RESTfull endpoints for a given route
We found that crude 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.