achingbrain / achingbrain/mongoose-crate
Retriving file fucntionality
- Dominant language
- JavaScript
- Stars
- 57
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
I'd like to write this functionality for the plugin. When it will be done I will make a pull request.
My question is - would you mind if I use ES6, promises, and generators. It will get us more clean and flat code.
For example, instead of this
``` javascript
tasks.push(function(callback) {
fs.exists(model[field].url, function(result) {
callback(!result ? new Error('No file exists at ' + model[field].url) : undefined)
})
})
```
it will be something like this
``` javascript
let result = yield fs.exists(model[field].url);
if (!result) { // and so on... }
```
And I'm planning to make a method which returns a promise, for being more eligible for `koa` apps and promise-based apps
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.