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

An in memory service store

  • 0.6.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

feathers-memory

Build Status

An in memory CRUD service for Feathers.

Installation

npm install feathers-memory --save

Documentation

Please refer to the Feathers database adapter documentation for more details or directly at:

  • In Memory - The detailed documentation for this adapter
  • Extending - How to extend a database adapter
  • Pagination and Sorting - How to use pagination and sorting for the database adapter
  • Querying - The common adapter querying mechanism

Complete Example

Here is an example of a Feathers server with a messages in-memory service that supports pagination:

import feathers from 'feathers';
import bodyParser from 'body-parser';
import rest from 'feathers-rest';
import memory from '../lib';

// Create a feathers instance.
const app = feathers()
  // Enable REST services
  .configure(rest())
  // Turn on JSON parser for REST services
  .use(bodyParser.json())
  // Turn on URL-encoded parser for REST services
  .use(bodyParser.urlencoded({ extended: true }));

// Create an in-memory Feathers service with a default page size of 2 items
// and a maximum size of 4
app.use('/messages', memory({
  paginate: {
    default: 2,
    max: 4
  }
}));

// Create a dummy Message
app.service('messages').create({
  text: 'Server message',
  read: false
}).then(function(message) {
  console.log('Created message', message);
});

// Start the server.
var port = 3030;

app.listen(port, function() {
  console.log(`Feathers server listening on port ${port}`);
});

You can run this example with npm run example from the cloned repository and going to localhost:3030/messages. You will see the test Message that we created at the end of that file.

Changelog

0.6.0

  • Use internal methods instead of service methods directly

0.4.0/0.5.0

  • Migrate to new ES6 plugin infrastructure and support all advanced querying mechanisms (#10)

0.3.0

  • Fixing how the module is exported.
  • Adding PATCH support back in

0.2.2

  • Minor bug fixes

0.2.1

0.2.0

  • Unknown

0.1.2

  • Unknown

0.1.1

  • Unknown

0.1.0

  • Initial release

License

Copyright (c) 2015

Licensed under the MIT license.

Keywords

FAQs

Package last updated on 22 Feb 2016

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