coreutils.js
Basic command line utilities, the Node.js way
This project is an implementation of the
GNU Coreutils commands in Javascript,
adding an object-oriented design and some Node.js
stream features while we were there :-)
This project has got inspiration and stolen borrowed code fragments from
shelljs and
bashful projects, and has implemented
some ideas from TermKit. The main
characteristic diferences from GNU Coreutils are
-
objects, not text: standard coreutils are independent programs where the
only one interface with the exterior world are character streams derived from
the usage on a terminal, so this text needs to be parsed each time between
commands. Coreutils.js is designed as a library of functions, so high-level
objects can be passed between them, and each one of them implement an inspect
method to be used when printing their content on a terminal to show their usual
behaviour.
-
streams, not lists: for commands that generates a list of values,
Coreutils.js return a Stream object instead of an Array (split data in time
instead of space) since they are easily convertible between them and has a
better performance and offers more flexibility for big data sets, reason why the
Streams API is the standard interface in Node.js modules allowing them to be
connected to others. Also each returned stream has an added type
attribute to
show the type of their contents and help to process them later.
Commands
textutils
fileutils
sh utils
bash built-ins
extras