blob: c466ac3404b38b4adf3b7a30763f15adeec608bc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
# mkdirp-infer-owner
[`mkdirp`](http://npm.im/mkdirp), but chown to the owner of the containing
folder if possible and necessary.
That is, on Windows and when running as non-root, it's exactly the same as
[`mkdirp`](http://npm.im/mkdirp).
When running as root on non-Windows systems, it uses
[`infer-owner`](http://npm.im/infer-owner) to find the owner of the
containing folder, and then [`chownr`](http://npm.im/chownr) to set the
ownership of the created folder to that same uid/gid.
This is used by [npm](http://npm.im/npm) to prevent root-owned files and
folders from showing up in your home directory (either in `node_modules` or
in the `~/.npm` cache) when running as root.
|