Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
feathers-memory
Advanced tools
An in memory CRUD service for feathers
Install the module with: npm install feathers-memory --save
var feathers = require('feathers');
var memory = require('feathers-memory')();
app.configure(feathers.rest()).use('/users', memory);
The feathers-memory service follows the same convention as all the other services. Therefore, it provides the following methods:
find
, get
, create
, update
, patch
, remove
and setup
.
var memoryService = {
find: function(params, callback) {},
get: function(id, params, callback) {},
create: function(data, params, callback) {},
update: function(id, data, params, callback) {},
patch: function(id, data, params, callback) {},
remove: function(id, params, callback) {},
setup: function(app) {}
}
var feathers = require('feathers');
var memory = require('feathers-memory')();
var app = feathers();
app.configure(feathers.rest())
.use('/users', memory)
.listen(8080);
You can also extend any of the feathers services to do something custom.
var feathers = require('feathers');
var memory = require('feathers-memory')();
var app = feathers();
var myUserService = memory.extend({
find: function(params, cb){
// Do something awesome!
console.log('I am extending the find method');
this._super.apply(this, arguments);
}
});
app.configure(feathers.rest())
.use('/users', myUserService)
.listen(8080);
You are probably also going to want to filter your data. You can do that by passing options via the body or in a query string. Like so:
GET /users?name=eric&limit=10&skip=10
Sort:
GET /users?sort[]=name&sort[]=age
Order:
GET /users?order=ascending
Skip:
GET /users?skip=10
Limit:
GET /users?limit=10
See examples directory.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
0.3.0
PATCH
support back in0.2.2
0.2.1
0.2.0
0.1.2
0.1.1
0.1.0
Copyright (c) 2014 Eric Kryski Licensed under the MIT license.
FAQs
An in memory service store
The npm package feathers-memory receives a total of 5,028 weekly downloads. As such, feathers-memory popularity was classified as popular.
We found that feathers-memory demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.