# How to list npm user-installed packages?

To list npm user-installed packages, you can use the `npm list` command in the terminal. By default, this command will show a tree-like structure of all installed packages for the current project. If you want to see a list of globally installed packages (user-installed), you can add the `-g` flag.

Here are the commands:

## List User-Installed Packages Locally:

```bash
npm list
```

This command will display a tree structure of locally installed packages for the current project.

## List User-Installed Packages Globally:

```bash
npm list -g --depth=0
```

- `g` flag indicates global packages.
- `-depth=0` flag specifies that you only want to see top-level packages without their dependencies.

Alternatively, you can use the following command to list globally installed packages without the dependencies:

```bash
npm -g ls --depth=0
```

These commands will output a list of globally installed packages along with their versions. If you want more details, you can remove the `--depth=0` flag, and npm will display the entire dependency tree.

Remember that the exact command might vary slightly based on your operating system and terminal environment.