S
S
Svyatoslav Khusamov2015-10-29 18:37:00
Node.js
Svyatoslav Khusamov, 2015-10-29 18:37:00

How to find the directory of a module loaded with require("module")?

I accidentally discovered the existence of the _homedir variable:

let module1 = require("module");
console.log(module1._homedir); // выдает путь к каталогу с модулем

Where did this variable come from? Is she regular? Where is the description?

Answer the question

In order to leave comments, you need to log in

8 answer(s)
K
Konstantin Kitmanov, 2015-10-29
@khusamov

All regular here: https://nodejs.org/api/modules.html

D
Dmitry Skogorev, 2013-06-05
@EnterSandman

zyxel keenetic giga

S
stepchuk, 2013-06-05
@stepchuk

MikroTik RB951G-2HnD is 100% suitable for all your requirements, including the price.

O
oia, 2013-06-05
@oia

assemble a pc, install linux, you can configure it for yourself

R
rinx, 2013-06-05
@rinx

1. Buy an old cheap computer, add an additional network card if necessary;
2. Put Pfsence there (http://macrodmin.blogspot.ru/2011/11/ustanovka-pfsense.html)
3.…
4. Profit!
But seriously, Pfsence is an excellent distribution that is built on the basis of FreeBSD. Very easy to set up via the web interface. There are a large number of packages that can be added and configured again via the web interface.
I myself assembled several gateways on it with various services: squid, VPN (PPTP, IPsec, OPenVPN), Guest Wifi with access by vouchers. They work stably.

I
ipswitch, 2013-06-06
@ipswitch

Keenetic, but not Giga II, but Ultra
zyxel.ru/keenetic-ultra

D
digdream, 2013-06-07
@digdream

at home I use asus RT-n16 - a gigabit switch, 128M RAM 32 flash. 100 Mbit from the provider pulls without problems. I use tomato firmware from shibby. previously there were problems with the disappearance of wifi, but since three releases ago the problem has disappeared.
I recommend taking a look.
I don’t have many consumers (HP microserver (Torrents, DLNA, ftp, web, subsonic, proxy, TS), 2 beeches, TV, receiver, phones, tablets, toys), but there are no problems with the band.

E
Evgeny Bezymyannikov, 2013-06-09
@psman

Asus RT-N66U - tested on Beeline and a number of other providers. both at home and in offices.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question