Let’s say I want to have a very simple package. It will only extend a normal Socket.
import {Socket} from 'net';
export class SpecialSocket extends Socket {
constructor() {
super(...arguments);
}
connect() {
return new Promise((resolve, reject) => {
this.once('connect', resolve).once('error', reject);
super.connect(...arguments);
});
}
}
Now I want to be able to have this on the client AND the server, but on the client, it will just make a promisified call to the server that returns when it is done.
How is this done with NPM and meteor?