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.1.3
  • 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('users'));

Documentation

Current Error Types:
  • GeneralError: 500
  • BadRequest: 400
  • NotAuthenticated: 401
  • Forbidden: 403
  • NotFound: 404
  • Timeout: 409
  • Conflict: 409
  • PaymentError: 409
  • Unprocessable: 422

Pro Tip: Feathers service adapters (ie. mongodb, memory, etc.) already emit the appropriate errors for you. :-)

Usage:
var feathers = require('feathers');
var errors = require('feathers-memory');
var app = feathers();

var userService = {
  find: function(params, callback) {

    // If you were to create an error yourself.
    callback(new this.app.errors.NotFound('User does not exist'));

    // You can also simply do something like this if you
    // just want to fire back a simple 500 error with your
    // custom message.
    // 
    // callback('A generic server error');
  },

  setup: function(app){
    this.app = app;
  }
};

app.configure(errors())
   .use('/users', userService)
   .use(errors.handler);
404 Handling:

We have conveniently created a basic 404 middleware as well. To use it:

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

app.configure(errors())
   .use('/users', userService)
   .use(errors.missing) // your 404 handler
   .use(errors.handler);

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.1.3

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