Advertisement
Gannon_

Untitled

Nov 28th, 2022
522
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const { builtinModules } = require('node:module')
  2.  
  3. const mots = []
  4.  
  5. for (const name of builtinModules) {
  6.   const module = require('node:' + name)
  7.   for (const keys of Object.keys(module)) {
  8.     if (typeof module[keys] === 'function') {
  9.       mots.push(keys)
  10.     }
  11.   }
  12. }
  13.  
  14. for (const keys of Object.keys(global)) {
  15.   if (typeof module[keys] === 'function') {
  16.     mots.push(keys)
  17.   }
  18. }
  19.  
  20. const uniqueMotsSort = [...new Set(mots)].sort((a, b) => a.localeCompare(b))
  21.  
  22. console.log(uniqueMotsSort.join('\n'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement