Simple Native node.js promise wrapper.
const defer = require('@rainder/defer');
const dfd = defer();
dfd.promise.then(...);
dfd.resolve(...);
dfd.reject(...);
const defer = require('@rainder/defer');
defer.callback((cb) => {
socket.write(data, cb);
}).then(...);
That's it.