Easy way to list node modules I have npm linked?

前端 未结 9 1203
情话喂你
情话喂你 2021-01-29 21:55

I am looking for a command that will list the names of global modules that I have npm link\'d to local copies, also listing the local path.

In fact, a list

9条回答
  •  误落风尘
    2021-01-29 22:29

    A better alternative to parsing ls is to use find like this:

    find . -type l
    

    You can use -maxdepth 1 to only process the first directory level:

    find . -maxdepth 1 -type l
    

    You can use -ls for additional info.

    For instance, for finding node modules that are npm linked:

    find node_modules -maxdepth 1 -type l -ls
    

    Here's an article why parsing ls is not the best idea

提交回复
热议问题