Closed kennarddh closed 1 year ago
Should I rewrite the lib or create dts file?
I'd say that the best option would be to rewrite it in Typescript, then export the JS file and types to a /lib folder, and ensure that that is used when publishing to NPM. I just found this guide that has the same idea: https://itnext.io/step-by-step-building-and-publishing-an-npm-typescript-package-44fe7164964c. Would that work?
Ok. I'll try it.
What is the use of the toString
function?
const socket = dgram.createSocket({
type: 'udp4',
reuseAddr: true,
toString: function () {
return 'udp4'
},
})
Typescript throw error because toString
doesn't exist in dgram.createSocket
options
Wow, amazing work on the PR! I have time on friday to look at it, test it and hopefully merge it. Thanks so far; it's appreciated!
Quick update: it's going to be tomorrow. Too much going on today :-)
I'll let you know!
As mentioned on the PR: looks good; thanks for the effort and the nice optimizations/cleanups here and there! I'll publish in a minute.
Just published!
Good idea; feel free to create a PR and I'll merge it!