3 ms·
well you are just replacing your dependency from cygwin to node.js think of it, what is the utility to implement shell commands in a cross-platform way ? only
by zwetan 11y ago
well you are just replacing your dependency from cygwin to node.js
think of it, what is the utility to implement shell commands in a cross-platform way ?
only for Windows
You don't need an ES6 implementation of `ls` on Linux and Mac OS X, the tools are already there and yeah they are "ugly" compiled to native executable, but it is exactly what you want for shell commands
so you are basically trying to solve a Windows problem, but sorry you're doing it wrong
Windows problem is not about lacking shell commands, it's about lacking a POSIX environment
sure you want command line utilities like `ls`, but those are mainly useful when run inside a POSIX environment, and that is exactly the problem that cygwin have solved.
Now about some statements
"No ugly DLLs":
try to do a `ldd /bin/ls` on a Linux system you will see dependencies on `libc.so`, `libselinux.so`, etc. having tool like `ls` being dependent on `cygwin.dll` etc. is perfectly normal, nothing ugly about it
"Works in any terminal":
all the cygwin binaries can work inside a `CMD.exe` prompt, just add the "C:\cygwin\bin" path to your environment variables.
when you run Bash shell like Mintty, you also have access to the `CMD.exe` environment on top of the POSIX environment, for ex: you can call powershell scripts.
"Let's mix some Windows & Unix commands together"
`$ ipconfig | grep IPv4 | sort` works perfectly fine under Cygwin with bash
"but I only want certain commands"
maybe use package management, for ex you could use apt-cyg with cygwin, and do things like `$ apt-cyg install ncurses` or `$ apt-cyg remove ncurses`
- EvanPlaice 11y agoV8 is a runtime. Cygwin is an entire OS ecosystem of dependencies, tools, libraries. POSIX utilities are so tightly coupled to the OS, it's virtually impossible to use them with any degree of confidence without importing the entire universe. There's nothing 'perfectly normal' about such a poorly structured architecture. JS dependencies are explicitly defined in a package's package.json so it's trivial to track a package's dependencies. Likewise, one could create a powershell implementation in JS and -- barring windows-specific features -- Powershell scripts would 'just work' in a nix environment as well. This package makes it trivial to port POSIX tools to Windows. What about greenfield development of utilities that need to work in both nix and Windows? Instead of building for one platform first then porting it to another (incl all the maintenance issues involved in maintaining separate forks in sync) why not use a truly cross-platform language from the start? The Javascript ecosystem comes with it's own package management system. Apt-get attempts to be 'everything to everybody'. It requires a monumental effort from the OSS community to maintain the different sources. Outdated packages are the norm making it harder for software maintainers to resolve bugs. Submitting new packages or publishing new versions of existing packages is a PITA. Etc... NPM's source is centralized and provides a very useful online portal for: searching for packages by keyword and/or tags; publishing the Readme ad human-readable HTML (ie via Markdown); finding related links to the source control, issues, project pages; tracking downloads and development progress stats. If you prefer not to publish to NPM the NPM directory, packages can be installed directly from GitHub, Bitbucket, etc. Tapping the broader exosystem is easy for both users and developers.