Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

feathers-memory

Package Overview
Dependencies
Maintainers
2
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

feathers-memory

Feathers in memory service

  • 0.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5K
increased by1.18%
Maintainers
2
Weekly downloads
 
Created
Source

feathers-memory Build StatusCode Climate

An in memory CRUD service for feathers

Getting Started

Install the module with: npm install feathers-memory --save

var feathers = require('feathers');
var memory = require('feathers-memory');

var app = feathers().use('/users', memory);

Documentation

API

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) {}
}
Usage:
var feathers = require('feathers');
var memory = require('feathers-memory');
var app = feathers();

app.use('/users', memory).listen(8080);
Extending:

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.use('/users', myUserService).listen(8080);
Advanced Querying

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

Examples

See examples directory.

Contributing

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.

Release History

0.2.1

  • Now utilizing feathers-errors
  • Proper documentation

0.2.0

  • Unknown

0.1.2

  • Unknown

0.1.1

  • Unknown

0.1.0

  • Initial release

License

Copyright (c) 2014 Eric Kryski Licensed under the MIT license.

Keywords

FAQs

Package last updated on 04 Jun 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc