Koa: Remove Makefile, put everything in npm scripts

Created on 27 Oct 2015  Â·  19Comments  Â·  Source: koajs/koa

make is not available on Windows. NPM scripts however can run anywhere. Makefiles are also unnecessarily complicated for something simple as running mocha or eslint with a few options. Also, in npm scripts, you don't have to specify the path of the binary.
@stojanovic looking forward to your PR

question

Most helpful comment

who's for and against this? my personal opinion: we should use npm scripts for wider compat, but not at the expense of having an unmanageable package.scripts object.

All 19 comments

I'm working on it ;)

Me too :)
Go for it, since I just stared :)

how many of koajs committers/contributors use windows?

Also, remember that cygwin/mingw, while somewhat of a pain, are still options, so it's not totally unworkable for Windows users.

who's for and against this? my personal opinion: we should use npm scripts for wider compat, but not at the expense of having an unmanageable package.scripts object.

I support Makefile because npm script is a fool choose for project. It only
support raw string, only.

2016-05-14 23:40 GMT+08:00 jongleberry [email protected]:

who's for and against this? my personal opinion: we should use npm scripts
for wider compat, but not at the expense of having an unmanageable
package.scripts object.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
https://github.com/koajs/koa/issues/559#issuecomment-219226923

I'm with jonathan, npm scripts unless they become unbearable.

Makefile is enough and npm scripts is not bad. But for universality, maybe npm scripts is more better:)

I vote npm scripts as well - they can get hairy, sure, but thats when you start breaking them out and chaining them instead.

Edit: Nevermind, we aren't doing that. They could work.

I have compared a machine running Node that was started with NPM and one that was started in pure node command. The one started by npm start was using more memory and cpu just because NPM was "processing" the Node process itself. Since that day my Makefile calls node directly.

So, maybe, Makefile should be preserved and you guys should run a benchmark.

That's one reason I don't use npm scripts, the extra ~300ms bugs me, and it adds extra output. Not a huge deal, but if Windows was less of a mess it wouldn't be a problem :D, amazing that after all these years there's no make implementation. Cramming everything in a single string gets hard to read too.

@tj having just switched to Mac from Windows myself and I can confirm the mess that is Windows 😄

Do NOT replace Makefile by NPM scripts, the slow NPM scripts is not really good. How about adding scripts for Windows users?

Yarn apparently solve npm scripts delay.

npm start take some extra RAM and CPU cycles. Start your application, with load, and than run top in shell to see how many memory and CPU are being used.

With this simple of a task, we could also consider just writing a Node.JS script, then adding barebone .sh and .cmd wrappers around it.

closed via #981

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tracker1 picture tracker1  Â·  3Comments

rainesinternationaldev picture rainesinternationaldev  Â·  5Comments

xinshouke picture xinshouke  Â·  4Comments

ilkkao picture ilkkao  Â·  4Comments

koalex picture koalex  Â·  3Comments