nodejs/deps/npm/man/man1/npm-root.1

39 lines
618 B
Groff
Raw Normal View History

.TH "NPM\-ROOT" "1" "April 2021" "" ""
.SH "NAME"
\fBnpm-root\fR \- Display npm root
.SS Synopsis
2014-09-24 14:41:07 -07:00
.P
.RS 2
2014-11-04 15:08:12 -08:00
.nf
npm root [\-g]
2014-11-04 15:08:12 -08:00
.fi
2014-09-24 14:41:07 -07:00
.RE
.SS Description
2014-09-24 14:41:07 -07:00
.P
Print the effective \fBnode_modules\fP folder to standard out\.
.P
Useful for using npm in shell scripts that do things with the
\fBnode_modules\fP folder\. For example:
.P
.RS 2
.nf
#!/bin/bash
global_node_modules="$(npm root \-\-global)"
echo "Global packages installed in: ${global_node_modules}"
.fi
.RE
.SS See Also
2014-09-24 14:41:07 -07:00
.RS 0
.IP \(bu 2
npm help prefix
2014-09-24 14:41:07 -07:00
.IP \(bu 2
npm help bin
2014-09-24 14:41:07 -07:00
.IP \(bu 2
npm help folders
2014-09-24 14:41:07 -07:00
.IP \(bu 2
npm help config
2014-09-24 14:41:07 -07:00
.IP \(bu 2
npm help npmrc
2014-09-24 14:41:07 -07:00
.RE