Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Lightweight REST API framework for Node.js, built on top of connect.
Lightweight REST API framework for Node.js, built on top of connect.
Alpha version
Restify is great, but it comes with semver versioning which is not the best choice when it comes to the API, DTrace as a dependency is also not a very good idea and Restify is actually very slow.
Restware tries to implement streight-forward versioning and routing that would make the deployment of new versions and hotfixes easier.
Instead of creating the whole new framework, Restware is actually just a set of middlewares for connect, that means you can choose what you want to use and you can also use other connect middlewares.
Connect is fast and Restware's middleware is also very efficient - it does only what the REST API needs. This makes Restware much faster then Restify (benchmark is comming soon).
$ npm install restware
var http = require('http'),
connect = require('connect'),
restware = require('restware');
var server = connect();
http.createServer(server);
server.use(restware.requestId());
server.use(restware.gzip());
server.use(restware.cors());
server.use(restware.queryParser());
server.use(restware.bodyParser());
server.use(restware.acceptParser());
server.use(restware.authParser());
server.use(restware.rangeParser());
server.use(restware.methodOverride());
server.use(restware.validator());
server.use(restware.requestHandler());
server.use(restware.errorHandler());
server.use(restware.formatter());
// register your controllers
restware.dispatcher.register(1, {
users: {
// mapped to GET /users
getCollection: function (req, reply) {
reply([...]);
},
// mapped to GET /users/:id
getModel: function(req, reply){
reply({ id: ... })
},
// mapped to PUT /users
putCollection: function(req, reply){
}
}
});
server.listen(3000, function () {
console.log('Listening on port 3000');
});
For more information about usage see /examples
directory where you'll find more about versioning, resource expansion and streaming.
Requires nodeunit
$ npm test
MIT
FAQs
Lightweight REST API framework for Node.js, built on top of connect.
The npm package restware receives a total of 0 weekly downloads. As such, restware popularity was classified as not popular.
We found that restware 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 researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.