|
|
|
|
|
by dastx
2568 days ago
|
|
Why does everything in node have to have all the dependencies in the world? ```
@sindresorhus/is
JSONStream
ansi-regex
ansi-styles
archive-type
argparse
asn1
async
balanced-match
base64-js
bcrypt-pbkdf
bl
bluebird
brace-expansion
buffer
buffer-alloc
buffer-alloc-unsafe
buffer-crc32
buffer-fill
buffer-from
cacheable-request
camelcase
caw
chalk
chownr
cliui
clone-response
color-convert
color-name
commander
concat-map
concat-stream
config-chain
content-disposition
core-util-is
cross-spawn
debug
decamelize
decode-uri-component
decompress
decompress-response
decompress-tar
decompress-tarbz2
decompress-targz
decompress-unzip
docker-modem
dockerode
download
duplexer3
emoji-regex
end-of-stream
escape-string-regexp
esprima
execa
ext-list
ext-name
fd-slicer
file-type
filename-reserved-regex
filenamify
find-up
from2
fs-constants
fs-extra
fs-minipass
fs.realpath
get-caller-file
get-proxy
get-stream
glob
got
graceful-fs
graceful-readlink
has-flag
has-symbol-support-x
has-to-string-tag-x
hasbin
http-cache-semantics
ieee754
inflight
inherits
ini
into-stream
invert-kv
ip
is-fullwidth-code-point
is-natural-number
is-object
is-plain-obj
is-port-available
is-retry-allowed
is-stream
isarray
isexe
isurl
js-yaml
json-buffer
jsonfile
jsonparse
keyv
lcid
locate-path
lodash
lowercase-keys
make-dir
map-age-cleaner
md5-file
mem
mime-db
mimic-fn
mimic-response
minimatch
minimist
minipass
minizlib
mkdirp
ms
mustache
nice-try
node-virtualbox
normalize-url
npm-conf
npm-run-path
object-assign
once
os-locale
p-cancelable
p-defer
p-event
p-finally
p-is-promise
p-limit
p-locate
p-timeout
p-try
path-exists
path-is-absolute
path-key
pend
pify
pinkie
pinkie-promise
prepend-http
process-nextick-args
progress
proto-list
pump
query-string
readable-stream
require-directory
require-main-filename
responselike
safe-buffer
safer-buffer
scp2
seek-bzip
semver
set-blocking
shebang-command
shebang-regex
signal-exit
simple-git
sort-keys
sort-keys-length
split-ca
sprintf-js
ssh2
ssh2-streams
streamsearch
strict-uri-encode
string-width
string_decoder
strip-ansi
strip-dirs
strip-eof
strip-outer
sudo-prompt
supports-color
tar
tar-fs
tar-stream
through
timed-out
to-buffer
trim-repeated
tunnel-agent
tweetnacl
typedarray
unbzip2-stream
universalify
url-parse-lax
url-to-options
util-deprecate
uuid
which
which-module
wrap-ansi
wrappy
xtend
y18n
yallist
yargs
yargs-parser
yauzl
``` |
|
A lot of the other dependencies are simply cruft, for example, `safe-buffer, `safer-buffer`, `buffer-alloc`, `buffer-alloc-unsafe` all patch the same issue and haven't been necessary since ~2016 / node 6.0. Same for `sort-keys`, object key sort order was baked into the ES2015 spec and has been the default behaviour since the beginning of the decade.
As mentioned by other commenters, this is a result of an extremely easy-to-use packaging system, coupled with a culture of sharing and reusability. The dark side of it is (justified) laziness and reinvention of the wheel - the core functionality of many of these modules can be written in one or two lines of code, but it is indeed faster and safer to just import something that exists and has been tested. The vast number of choices means it's hard to find standard solutions, and this also encourages developers to create their own 'improved' version of everything, in a self-reinforcing loop. The language itself has been in constant change, meaning new flavours of previously stable modules pop up to support new patterns (promises, generators, await, classes, etc etc). Then you get egos, marketing and corporate sponsorship added to the mix :)