Helidium / Mitol

Lightweight NodeJS http server
Other
175 stars 5 forks source link

NPM? #2

Closed lukeed closed 7 years ago

lukeed commented 7 years ago

Hi there! Would love to try this out in real products, but realistically, it would only be feasible if I could load this in via npm.

Is there any way that this is possible?

FWIW, as of writing this, the name mitol is available.

Helidium commented 7 years ago

Hi Luke,

Thanks for your interest in the project!

Creating a npm module is one of the milestones of the project. It is possible through node-gyp, keep in mind only Linux platform has been tested, Mac compiles, but I haven't tested it yet. Windows is currently not supported.

I will prepare and publish a npm package.

Best regards,

lukeed commented 7 years ago

Great! Glad to hear. Looking forward to it~

Helidium commented 7 years ago

I have added the package to npm directory. Make sure you have node-gyp globally installed as well as python and build-tools. As mentioned before, currently only linux is supported and tested. More platforms are coming soon.

Install the module using npm i mitol and in your code replace require('http') with require('mitol').

@lukeed Can you test it?

Thank you,

Helidium commented 7 years ago

Seems npm package is working, so I am closing this issue. Thank you

lukeed commented 7 years ago

Hi, sorry~! I've been having a hectic work week 😞 I'll look forward to testing it out this weekend!

I'm curious if there's another way to ship this, without node-gyp. I ask because of the need to have X,Y,Z deps installed on a machine in order for node-gyp to run.

...May very well be the only avenue. TBH, this isn't my area at all 😉

Helidium commented 7 years ago

Hi Luke,

No worries, we have all been there I guess :). Great for you to test it, please let me know how it works out for you.

There is a way to publish it without node-gyp dependency, although it would mean to publish prebuilt binaries. Currently I will leave node-gyp dependency, but will consider binary deployment in the future.

You can prebuild the package using docker or another vm and copy the binaries based on your NodeJS and platform version.

Thank you for your time and effort to test the project!

Best regards,