Where can I get an array of all native node modules?
I am looking for a way to get a list of all available node modules. It would be interesting to get this dynamically, because different versions or future versions may add or deprecate modules.
javascript node.js
add a comment |
I am looking for a way to get a list of all available node modules. It would be interesting to get this dynamically, because different versions or future versions may add or deprecate modules.
javascript node.js
cd /usr/share/doc/nodejs/api | find ./ -name "*.md"
– Vadim Hulevich
Jan 2 at 9:34
add a comment |
I am looking for a way to get a list of all available node modules. It would be interesting to get this dynamically, because different versions or future versions may add or deprecate modules.
javascript node.js
I am looking for a way to get a list of all available node modules. It would be interesting to get this dynamically, because different versions or future versions may add or deprecate modules.
javascript node.js
javascript node.js
asked Jan 2 at 8:52
ThomasReggiThomasReggi
18.5k44148273
18.5k44148273
cd /usr/share/doc/nodejs/api | find ./ -name "*.md"
– Vadim Hulevich
Jan 2 at 9:34
add a comment |
cd /usr/share/doc/nodejs/api | find ./ -name "*.md"
– Vadim Hulevich
Jan 2 at 9:34
cd /usr/share/doc/nodejs/api | find ./ -name "*.md"
– Vadim Hulevich
Jan 2 at 9:34
cd /usr/share/doc/nodejs/api | find ./ -name "*.md"
– Vadim Hulevich
Jan 2 at 9:34
add a comment |
4 Answers
4
active
oldest
votes
If you are using Node version > 8.11.3, the recommended way to achieve that is to use the builtinModules
property of the module
object, as follows:
const builtins = require('module').builtinModules;
Further details: https://nodejs.org/api/modules.html#modules_module_builtinmodules
add a comment |
You can use this code to get the list of all globally installed modules:
function exec(callback) {
require('child_process').exec('npm ls -g --depth=0 --json', function(err, data, stderr) {
if (err) return cb(err)
callback(data);
});
}
function get_modules(callback) {
var res = ;
exec(function(d) {
d = JSON.parse(d);
var m = d.dependencies;
for(key in m) res.push(key);
callback(res);
});
}
get_modules(console.log);
If you want built-in modules , use
console.log(require("module").builtinModules)
Refer this doc.
add a comment |
You can get the list of native modules like this:
const repl = require('repl')
console.log(repl._builtinLibs)
This way you get the native modules available in your specific version of Nodejs.
add a comment |
const m = [
"assert",
"buffer",
"child_process",
"cluster",
"console",
"constants",
"crypto",
"dgram",
"dns",
"domain",
"events",
"fs",
"http",
"https",
"module",
"net",
"os",
"path",
"process",
"punycode",
"querystring",
"readline",
"repl",
"stream",
"string_decoder",
"sys",
"timers",
"tls",
"tty",
"url",
"util",
"vm",
"zlib"
];
1
Is this a joke?
– ruakh
Jan 2 at 9:27
@ruakh no I think it's useful to have an array of all of them same as this list here stackoverflow.com/questions/14168703/crypto-algorithm-list
– ThomasReggi
Jan 2 at 10:02
Maybe it would be better to add this list in the question or in an answer, the same way as in the link you refer to.
– TGrif
Jan 2 at 17:58
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54003490%2fwhere-can-i-get-an-array-of-all-native-node-modules%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you are using Node version > 8.11.3, the recommended way to achieve that is to use the builtinModules
property of the module
object, as follows:
const builtins = require('module').builtinModules;
Further details: https://nodejs.org/api/modules.html#modules_module_builtinmodules
add a comment |
If you are using Node version > 8.11.3, the recommended way to achieve that is to use the builtinModules
property of the module
object, as follows:
const builtins = require('module').builtinModules;
Further details: https://nodejs.org/api/modules.html#modules_module_builtinmodules
add a comment |
If you are using Node version > 8.11.3, the recommended way to achieve that is to use the builtinModules
property of the module
object, as follows:
const builtins = require('module').builtinModules;
Further details: https://nodejs.org/api/modules.html#modules_module_builtinmodules
If you are using Node version > 8.11.3, the recommended way to achieve that is to use the builtinModules
property of the module
object, as follows:
const builtins = require('module').builtinModules;
Further details: https://nodejs.org/api/modules.html#modules_module_builtinmodules
answered Jan 2 at 9:42
Itay MamanItay Maman
23.1k868104
23.1k868104
add a comment |
add a comment |
You can use this code to get the list of all globally installed modules:
function exec(callback) {
require('child_process').exec('npm ls -g --depth=0 --json', function(err, data, stderr) {
if (err) return cb(err)
callback(data);
});
}
function get_modules(callback) {
var res = ;
exec(function(d) {
d = JSON.parse(d);
var m = d.dependencies;
for(key in m) res.push(key);
callback(res);
});
}
get_modules(console.log);
If you want built-in modules , use
console.log(require("module").builtinModules)
Refer this doc.
add a comment |
You can use this code to get the list of all globally installed modules:
function exec(callback) {
require('child_process').exec('npm ls -g --depth=0 --json', function(err, data, stderr) {
if (err) return cb(err)
callback(data);
});
}
function get_modules(callback) {
var res = ;
exec(function(d) {
d = JSON.parse(d);
var m = d.dependencies;
for(key in m) res.push(key);
callback(res);
});
}
get_modules(console.log);
If you want built-in modules , use
console.log(require("module").builtinModules)
Refer this doc.
add a comment |
You can use this code to get the list of all globally installed modules:
function exec(callback) {
require('child_process').exec('npm ls -g --depth=0 --json', function(err, data, stderr) {
if (err) return cb(err)
callback(data);
});
}
function get_modules(callback) {
var res = ;
exec(function(d) {
d = JSON.parse(d);
var m = d.dependencies;
for(key in m) res.push(key);
callback(res);
});
}
get_modules(console.log);
If you want built-in modules , use
console.log(require("module").builtinModules)
Refer this doc.
You can use this code to get the list of all globally installed modules:
function exec(callback) {
require('child_process').exec('npm ls -g --depth=0 --json', function(err, data, stderr) {
if (err) return cb(err)
callback(data);
});
}
function get_modules(callback) {
var res = ;
exec(function(d) {
d = JSON.parse(d);
var m = d.dependencies;
for(key in m) res.push(key);
callback(res);
});
}
get_modules(console.log);
If you want built-in modules , use
console.log(require("module").builtinModules)
Refer this doc.
edited Jan 2 at 10:01
answered Jan 2 at 9:22
vinoth hvinoth h
371110
371110
add a comment |
add a comment |
You can get the list of native modules like this:
const repl = require('repl')
console.log(repl._builtinLibs)
This way you get the native modules available in your specific version of Nodejs.
add a comment |
You can get the list of native modules like this:
const repl = require('repl')
console.log(repl._builtinLibs)
This way you get the native modules available in your specific version of Nodejs.
add a comment |
You can get the list of native modules like this:
const repl = require('repl')
console.log(repl._builtinLibs)
This way you get the native modules available in your specific version of Nodejs.
You can get the list of native modules like this:
const repl = require('repl')
console.log(repl._builtinLibs)
This way you get the native modules available in your specific version of Nodejs.
answered Jan 2 at 9:37
TGrifTGrif
3,36681936
3,36681936
add a comment |
add a comment |
const m = [
"assert",
"buffer",
"child_process",
"cluster",
"console",
"constants",
"crypto",
"dgram",
"dns",
"domain",
"events",
"fs",
"http",
"https",
"module",
"net",
"os",
"path",
"process",
"punycode",
"querystring",
"readline",
"repl",
"stream",
"string_decoder",
"sys",
"timers",
"tls",
"tty",
"url",
"util",
"vm",
"zlib"
];
1
Is this a joke?
– ruakh
Jan 2 at 9:27
@ruakh no I think it's useful to have an array of all of them same as this list here stackoverflow.com/questions/14168703/crypto-algorithm-list
– ThomasReggi
Jan 2 at 10:02
Maybe it would be better to add this list in the question or in an answer, the same way as in the link you refer to.
– TGrif
Jan 2 at 17:58
add a comment |
const m = [
"assert",
"buffer",
"child_process",
"cluster",
"console",
"constants",
"crypto",
"dgram",
"dns",
"domain",
"events",
"fs",
"http",
"https",
"module",
"net",
"os",
"path",
"process",
"punycode",
"querystring",
"readline",
"repl",
"stream",
"string_decoder",
"sys",
"timers",
"tls",
"tty",
"url",
"util",
"vm",
"zlib"
];
1
Is this a joke?
– ruakh
Jan 2 at 9:27
@ruakh no I think it's useful to have an array of all of them same as this list here stackoverflow.com/questions/14168703/crypto-algorithm-list
– ThomasReggi
Jan 2 at 10:02
Maybe it would be better to add this list in the question or in an answer, the same way as in the link you refer to.
– TGrif
Jan 2 at 17:58
add a comment |
const m = [
"assert",
"buffer",
"child_process",
"cluster",
"console",
"constants",
"crypto",
"dgram",
"dns",
"domain",
"events",
"fs",
"http",
"https",
"module",
"net",
"os",
"path",
"process",
"punycode",
"querystring",
"readline",
"repl",
"stream",
"string_decoder",
"sys",
"timers",
"tls",
"tty",
"url",
"util",
"vm",
"zlib"
];
const m = [
"assert",
"buffer",
"child_process",
"cluster",
"console",
"constants",
"crypto",
"dgram",
"dns",
"domain",
"events",
"fs",
"http",
"https",
"module",
"net",
"os",
"path",
"process",
"punycode",
"querystring",
"readline",
"repl",
"stream",
"string_decoder",
"sys",
"timers",
"tls",
"tty",
"url",
"util",
"vm",
"zlib"
];
answered Jan 2 at 8:53
ThomasReggiThomasReggi
18.5k44148273
18.5k44148273
1
Is this a joke?
– ruakh
Jan 2 at 9:27
@ruakh no I think it's useful to have an array of all of them same as this list here stackoverflow.com/questions/14168703/crypto-algorithm-list
– ThomasReggi
Jan 2 at 10:02
Maybe it would be better to add this list in the question or in an answer, the same way as in the link you refer to.
– TGrif
Jan 2 at 17:58
add a comment |
1
Is this a joke?
– ruakh
Jan 2 at 9:27
@ruakh no I think it's useful to have an array of all of them same as this list here stackoverflow.com/questions/14168703/crypto-algorithm-list
– ThomasReggi
Jan 2 at 10:02
Maybe it would be better to add this list in the question or in an answer, the same way as in the link you refer to.
– TGrif
Jan 2 at 17:58
1
1
Is this a joke?
– ruakh
Jan 2 at 9:27
Is this a joke?
– ruakh
Jan 2 at 9:27
@ruakh no I think it's useful to have an array of all of them same as this list here stackoverflow.com/questions/14168703/crypto-algorithm-list
– ThomasReggi
Jan 2 at 10:02
@ruakh no I think it's useful to have an array of all of them same as this list here stackoverflow.com/questions/14168703/crypto-algorithm-list
– ThomasReggi
Jan 2 at 10:02
Maybe it would be better to add this list in the question or in an answer, the same way as in the link you refer to.
– TGrif
Jan 2 at 17:58
Maybe it would be better to add this list in the question or in an answer, the same way as in the link you refer to.
– TGrif
Jan 2 at 17:58
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54003490%2fwhere-can-i-get-an-array-of-all-native-node-modules%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
cd /usr/share/doc/nodejs/api | find ./ -name "*.md"
– Vadim Hulevich
Jan 2 at 9:34