Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mention npm run in the shell scripts section #22

Open
ghost opened this issue Jan 3, 2014 · 14 comments
Open

mention npm run in the shell scripts section #22

ghost opened this issue Jan 3, 2014 · 14 comments

Comments

@ghost
Copy link

ghost commented Jan 3, 2014

For the Modern tools vs Shell scripts section, npm run deserves a mention since it gives you many of the benefits of shell scripts without all the up-front configuration that many of the other tools require. Here's the article I wrote about using npm run with the package.json scripts field: task automation with npm run.

Augmented with other narrowly focused tools on npm, you can get a lot done. Here's another example that uses catw and watchify to watch and rebuild less and javascript whenever a file changes.

The biggest benefit to this shell-oriented way of organizing things is that you don't need up-front coordination among the tool authors, so it's much easier to integrate pieces that have already been written that can read and write to stdin and stdout rather than having to write a grunt-* or gulp-* plugin to wrap the functionality manually. You're much more free to recombine the pieces in novel ways and to add components piecemeal. The downside is that there is a learning curve if you don't already know bash and it can take time to discover which tools you really like and fit your mental model and standard approaches well. This is also true of integrated solutions but there is more prescription about which tools are the "best" which I personally dislike because I so often disagree with those prescriptions.

I think "modern tools vs shell scripts" is perhaps not the right way to phrase the dialectic here. It's more about vertically-integrated tools versus more horizontally-oriented tools, or top-down vs bottom-up or centralized vs decentralized or integrated tooling vs unix. It's the same thing as [chaotic vs lawful alignment](http://annex.wikia.com/wiki/Alignment_(Dungeons_%26_Dragons%29).

@passy
Copy link
Member

passy commented Jan 3, 2014

👍

I think "modern tools vs shell scripts" is perhaps not the right way to phrase the dialectic here.

I fully agree. While the motive behind this title is clearly the organically grown, unmaintainable 5k shell script that most of us have either seen or written at some point, it should be made clear that there are indeed benefits of piecing together your processing pipeline on the OS level (ie. STDIN/STDOUT) as opposed to the node level and shell scripts aren't inherently bad.

@Raynos
Copy link

Raynos commented Jan 3, 2014

👍

It's worth mentioning npm run as that is sufficient for most modules, where as "full blown modern tools" might be more useful for large applications, where scope is much more complex.

@sindresorhus
Copy link
Contributor

👍 definitely, I use it a lot, and works great for simple things.

@tomByrer
Copy link

tomByrer commented Jan 4, 2014

Sounds great!
Does "mention" mean a paragraph, or a short chapter? Sounds to me a short chapter is better since you have so many examples & have a richer contrast vs other concepts.

@michealbenedict
Copy link
Contributor

The biggest benefit to this shell-oriented way of organizing things is that you don't need up-front coordination among the tool authors, so it's much easier to integrate pieces that have already been written that can read and write to stdin and stdout rather than having to write a grunt-* or gulp-* plugin to wrap the functionality manually. You're much more free to recombine the pieces in novel ways and to add components piecemeal. The downside is that there is a learning curve if you don't already know bash and it can take time to discover which tools you really like and fit your mental model and standard approaches well.

It's more about vertically-integrated tools versus more horizontally-oriented tools, or top-down vs bottom-up or centralized vs decentralized or integrated tooling vs unix.

I personally vote for having this content explicitly called out in the book.

Does "mention" mean a paragraph, or a short chapter? Sounds to me a short chapter is better since you have so many examples & have a richer contrast vs other concepts.

A short chapter makes more since since npm run should be regarded as one of the tools to get a task done.

@addyosmani
Copy link
Member

A strong 👍. I would love to see a chapter on npm run and the workflows it enables. @substack I enjoyed your task automation write-up and imagine others would be equally as interested in reading a complete section that fleshes his out some more.

addyosmani added a commit that referenced this issue Jan 7, 2014
@wilmoore
Copy link
Contributor

wilmoore commented Jan 9, 2014

👍

@addyosmani
Copy link
Member

I just wanted to follow up on this section. We currently have authors working on chapters for other tools but haven't got a committed author for the npm run section just yet. Would anyone be interested in taking this one on or re-purposing some of their existing content into a 1-2 pager on the workflow for it? If we can't find an author, we'll just link to @substack's article in the interim.

@wilmoore
Copy link
Contributor

wilmoore commented Apr 6, 2014

@addyosmani: I'd be happy to put together a 1-2 pager for npm run.

@sindresorhus
Copy link
Contributor

@wilmoore still interested? :)

@wilmoore
Copy link
Contributor

@wilmoore still interested? :)

Sure...I'm still up for it. I can probably start working on it next week given I'm heads-down preparing for a BETA release this week.

@wilmoore
Copy link
Contributor

wilmoore commented Dec 1, 2014

I've made an initial crack at documenting npm run here #66.

@addyosmani
Copy link
Member

Thanks @wilmoore!

@wilmoore
Copy link
Contributor

wilmoore commented Dec 1, 2014

@addyosmani 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants