I am looking for a way to get an exact up-to-date list of all Node.js core modules. Is there an NPM module that supplies such a running list? Somewhere in the annals of my life
J4F: you can use the github api and get a list of files directly in JSON format.
var http = require('https')
var path = require('path')
var options = {
hostname: 'api.github.com',
path: '/repos/nodejs/node/contents/lib',
method: 'GET',
headers: { 'Content-Type': 'application/json',
'user-agent': 'nodejs/node'
}
}
var req = http.request(options, (res) => {
res.setEncoding('utf8')
var body = ""
res.on('data', (data) => { body += data })
res.on('end', () => {
var list = []
body = JSON.parse(body)
body.forEach( (f) => {
if (f.type === 'file' && f.name[0]!=='_' && f.name[0]!=='.') {
list.push(path.basename(f.name,'.js'))
}
})
console.log(list)
})
})
req.on('error', (e) => { throw (e) } )
req.end()