forkrun
nvm
forkrun | nvm | |
---|---|---|
18 | 313 | |
136 | 75,736 | |
- | 1.1% | |
9.7 | 7.8 | |
7 days ago | about 2 months ago | |
Shell | Shell | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
forkrun
- Forkrun: Runs multiple inputs through a command in parallel using bash coprocs
- Forkrun – A pure-bash function for parallelizing loops
-
rparse: an easy-to-use shell script/function option parser that uses regex to determine which inputs are options
EDIT: moved code + example to GITHUB
-
[BASH] Can I use procfs to change the file that a backgrounded process is writing data to?
One example that I dont know how to do streaming for involves breaking up the stdin stream and sending it to different places, but where you determine where to send it in realtime. This isnt the code that spawned this particular thread, but a good example of this is in this function I wrote called forkrun.
-
Optimizing bash scripts?
If you want an example of a really optimized bash script check out my forkrun utility. I spent a really long time optimizing it. It parallelizes loops (like xargs -P and parallel), and for problems with "many very quick iterations" (e.g., sha256sum of a million tiny files) it is twice as fast as the fastest method available via xargs or parallel (which means it is outpacing well optimized compiled C/C++ binaries).
-
Bash continuous parallelization
as it so happens, I recently wrote a script called forkrun that parallelizes loops really fast. In particular for things like your simulation that require running 1 at a time in parallel (N parallel batches of 1 simulation, as opposed to N parallel batches of M simulations) the parallelization framework itself is 7x faster than xargs -l 1 -P N and ~25x faster than parallel -j N.
-
Globals or not globals?
However, if you have bash 4 or later, using bash coprocs can offer much better performance. The idea is that you spawn a bunch of persistent coprocs and pipe data to them, allowing you to parallelize the loop without forking each individual iteration. I wrote / am writing a utility called forkrun that parallelizes loops using bash coprocs. You're welcome to use it, though heads up it is still in beta (almost everything works, but I am still debugging the -k flag sometimes not working properly...-k ensures the output order is the same as input order). If nothing else it gives a real world example of parallelizing using coprocs.
-
Can you force bash to not give a throw a specific error?
Side note: in case you were wondering the actual code that inspired this post is my forkrun utility. If you felt like checking it out Id love to hear any feedback you might have on it.
-
Out of curiosity, what is your best script you can showcase?
For me? My personal best script is (by a wide margin) my forkrun utility. It uses bash coprocs to efficiently parallelize loops. Usage is nearly identical to xargs -P <#>. Options are similar to xargs....a few are missing (namely those related to running things interactively), and a few options are things xargs doesnt do but forkrun can.
-
How can I run commands in parallel and write the output of each command to different linux terminals, one linux terminal for each command running in parallel.
I wrote a nifty function for parallelizing loops in bash really fast called forkrun. It will, with the help of tail -F, let you do this (among many other things) by writing the output from each parallel worker to a separate file, which you can then monitor in real time with tail -F in another terminal window.
nvm
-
Software Engineering Workflow
Node.js + Nvm - runtime for javascript without a browser
-
Write a schema only absolutely no code backend server with Node.js and Teo!
Install Node.js if it hasn't been installed. There are several ways to install Node.js. You may download the installer from the official website, or install it with tools like NVM. After installation, run this command to verify its installation.
-
AI for Web Devs: Deploying Your AI App to Production
Our server also needs Node.js to run our app. We could install the binary directly, but I prefer to use a tool called NVM, which allows us to easily manage Node versions. We can install it with this command:
-
How To Set Up Your Coding Environment
By setting up your environment in isolation, you can prevent yourself from a lot of issues when experimenting with code. It makes your code behave more predictable due to the defined state of the runtime environment you are working with. This article should provide you with enough information to get started, but obviously, there is a lot more power embedded in NVM, Virtual Environment and RBEnv. So make sure to check their documentation.
-
Effective nodejs version management for the busy developer
I highly recommend setting up nodejs with a version manager, nvm was and still is a popular option, however, I now recommend and have been using fnm, a simpler and faster alternative to manage my nodejs versions.
-
A Journey to Find an Ultimate Development Environment
The purpose of a version manager is to help you navigate or install any tools for development easily. Version Manager can be one tool for each dependency (e.g. NVM, g) or One tool for all dependencies (e.g. asdf, mise).
-
NVM – Node Version Management
I usually develop on Windows so I installed NVM for Windows from here, but if you’re on other OS I’m sure you can find a version that supports it, probably this is the answer.
- Configurar Solana en Linux
-
How to quickly setup NodeJS with NVM
This was a very quick introduction to how I setup NodeJS on my environment using nvm. If you have any questions please refer to the official documentation or contact me via my Social Links.
-
"npm can’t be eliminated from the equation when you’re dealing with JavaScript" - True or false?
Source: Can this be used to create/download npm as a standalone executable? #3237.
What are some alternatives?
pkm - A super minimal TUI package manager wrapper written in BASH v4.2+
nvs - Node Version Switcher - A cross-platform tool for switching between versions and forks of Node.js
bin - my bins (mostly shell scripts)
fnm - 🚀 Fast and simple Node.js version manager, built in Rust
resholve - a shell resolver? :) (find and resolve shell script dependencies)
asdf - Extendable version manager with support for Ruby, Node.js, Elixir, Erlang & more
dyetide - a bash script that replaces hex, rgb, or hsl color codes out for other color codes. either within a file or from the terminal!
corepack - Zero-runtime-dependency package acting as bridge between Node projects and their package managers
dun - Meeting notes and todo tasks CLI
volta - Volta: JS Toolchains as Code. ⚡
fml - :card_index_dividers: A stupid simple, fast TUI file manager written in BASH v4.2+
SDKMan - The SDKMAN! Command Line Interface