This repository has been archived by the owner on Mar 23, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrading to ES6, common querying and latest plugin infrastructure.
- Loading branch information
Showing
17 changed files
with
376 additions
and
698 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": [ "es2015" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,30 @@ | ||
lib-cov | ||
*.seed | ||
# Logs | ||
logs | ||
*.log | ||
*.csv | ||
*.dat | ||
*.out | ||
*.pid | ||
*.gz | ||
|
||
# Runtime data | ||
pids | ||
logs | ||
results | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directory | ||
# Commenting this out is preferred by some people, see | ||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- | ||
node_modules | ||
|
||
# Users Environment Variables | ||
.lock-wscript | ||
|
||
npm-debug.log | ||
node_modules/ | ||
tmp/ | ||
lib/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,30 @@ | ||
{ | ||
"globals": { | ||
"it": true, | ||
"describe": true, | ||
"before": true, | ||
"after": true, | ||
"exports": true | ||
}, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"immed": true, | ||
"latedef": "nofunc", | ||
"newcap": true, | ||
"noarg": true, | ||
"sub": true, | ||
"undef": true, | ||
"unused": true, | ||
"boss": true, | ||
"eqnull": true, | ||
"node": true | ||
"node": true, | ||
"esnext": true, | ||
"bitwise": true, | ||
"camelcase": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"immed": true, | ||
"indent": 2, | ||
"latedef": "nofunc", | ||
"newcap": false, | ||
"noarg": true, | ||
"quotmark": "single", | ||
"regexp": true, | ||
"undef": true, | ||
"unused": true, | ||
"strict": false, | ||
"trailing": true, | ||
"smarttabs": true, | ||
"white": false, | ||
"node": true, | ||
"globals": { | ||
"it": true, | ||
"describe": true, | ||
"before": true, | ||
"beforeEach": true, | ||
"after": true, | ||
"afterEach": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.idea/ | ||
src/ | ||
test/ | ||
!lib/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
language: node_js | ||
node_js: | ||
- "0.10" | ||
- 'node' | ||
- 'iojs' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2015 Feathers | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,143 +1,20 @@ | ||
# feathers-memory [![Build Status](https://travis-ci.org/feathersjs/feathers-memory.svg?branch=master)](https://travis-ci.org/feathersjs/feathers-memory)[![Code Climate](https://codeclimate.com/github/feathersjs/feathers-memory.png)](https://codeclimate.com/github/feathersjs/feathers-memory) | ||
# feathers-memory | ||
|
||
> An in memory CRUD service for [feathers](http://feathersjs.com) | ||
[![Build Status](https://travis-ci.org/feathersjs/feathers-memory.png?branch=master)](https://travis-ci.org/feathersjs/feathers-memory) | ||
|
||
## Getting Started | ||
> An in memory service store | ||
Install the module with: `npm install feathers-memory --save` | ||
## About | ||
|
||
```js | ||
var feathers = require('feathers'); | ||
var memory = require('feathers-memory')(); | ||
|
||
app.configure(feathers.rest()).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`. | ||
|
||
```js | ||
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: | ||
|
||
```js | ||
var feathers = require('feathers'); | ||
var memory = require('feathers-memory')(); | ||
var app = feathers(); | ||
|
||
app.configure(feathers.rest()) | ||
.use('/users', memory) | ||
.listen(8080); | ||
``` | ||
|
||
#### Extending: | ||
|
||
You can also extend any of the feathers services to do something custom. | ||
|
||
```js | ||
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); | ||
``` | ||
|
||
#### 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](https://github.com/feathersjs/feathers-memory/tree/master/examples). | ||
|
||
## 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](http://gruntjs.com/). | ||
|
||
## Release History | ||
__0.3.0__ | ||
|
||
- Fixing how the module is exported. | ||
- Adding `PATCH` support back in | ||
|
||
__0.2.2__ | ||
|
||
- Minor bug fixes | ||
|
||
__0.2.1__ | ||
|
||
- Now utilizing [feathers-errors](https://github.com/feathersjs/feathers-errors) | ||
- Proper documentation | ||
|
||
__0.2.0__ | ||
|
||
- Unknown | ||
|
||
__0.1.2__ | ||
|
||
- Unknown | ||
|
||
__0.1.1__ | ||
|
||
- Unknown | ||
## Changelog | ||
|
||
__0.1.0__ | ||
|
||
- Initial release | ||
|
||
## License | ||
Copyright (c) 2014 [Eric Kryski](https://github.com/ekryski) | ||
Licensed under the [MIT license](https://github.com/feathersjs/feathers-memory/blob/master/LICENSE-MIT). | ||
|
||
Copyright (c) 2015 | ||
|
||
Licensed under the [MIT license](LICENSE). |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.