-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update npm dependencies #15
base: master
Are you sure you want to change the base?
Update npm dependencies #15
Conversation
you might want to check the 'del' dependancy. it changed to a promise API, so it might break the callback on line 33. Tests will pass as the tests use a different delFn. |
Hey. Happy to accept this PR (except for the note above), but there's a conflict now. |
Ah, I totally forgot about this. One of my goals this year is to start contributing back to open source projects I use. I fixed just the conflict, and I'll look at the other issue today! |
I implemented a change where Also I noticed the syntax wasn't consistent, so I beautified the code. |
I also tried it in a project I'm working on right now, and it's working with no problems. |
I totally forgot about this too - my bad! Nice, happy with this except for one thing: not really happy adding bluebird as a dependency just to promisify a function that is only really used during testing. Two alternatives:
Both are breaking changes, but I'm happy not supporting Node 0.10 anymore. |
Yeah, I took the lazy route and just used bluebird. Is there an easy way to turn a non-promise into a promise with the native Promise? I've actually only used bluebird for that sort of thing. Or, if you want to change it so that |
function promisify(fn) {
return new Promise(function (resolve) {
fn(resolve);
});
} Untested, but something like that should work. Could also wrap it in a try-catch block for the |
That didn't seem to work. I did come across this package though, and this solution seems to work: Maybe could just add it as a dev dependency? |
Ah what I wrote isn't a promisify function, it's what you would return as delFn - ignore that! This should work: function promisify(fn) {
return function () {
var args = Array.prototype.slice.call(arguments);
return new Promise(function (resolve) {
fn.apply(null, args.concat(resolve));
});
};
} If that doesn't work just go ahead and add the dependency :) |
That one didn't quite do it either. I swapped out bluebird for that promisify-function package. |
Oh also, I just realized, that promisify-function package uses babel to transpile for compatibility back to only node 4. |
Looks good now! I've updated the travis versions on master, could you rebase onto master and then when the tests are merged I'll merge this. Thanks! |
8f8036c
to
ddd4868
Compare
ddd4868
to
5d5d6e8
Compare
So I did a squash rebase on the branch. The things I did in this PR, in case you want to add it to the release notes:
|
Great package you have here, but I noticed the dependencies are out of date.
I ran the test script, and everything is still green.