npm install latest available packages 1

npm install latest available packages

npm outdated --parseable --depth=0 | cut -d: -f4 | xargs npm install

Here is what the above code is Doing:
1. npm outdated –parseable –depth=0
– npm outdated lists all the packages that are outdated
– –parseable makes the output easier to parse
– –depth=0 makes sure that only the top level packages are listed
2. cut -d: -f4
– cut is a command line utility that splits a string into pieces
– -d: tells cut to use : as the delimiter
– -f4 tells cut to only print the 4th field
3. xargs npm install
– xargs is a command line utility that takes the output of a command and passes it as arguments to another command
– npm install takes a list of packages and installs them

Similar Posts