Skip to content

evenstensberg/module-map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

module map nodejs

Module map lets you discover size, last edited and content of a module. It also shows the dependencies of a module.

Installation

npm install --save module-map-nodejs

Usage

const modules = moduleMap({
  source: "./your-path",
});

Example

const vm = require("vm");
const moduleMap = require("./index");

const modules = moduleMap({
  source: "./test2",
});

for (let [key, value] of Object.entries(modules)) {
  const context = {
    require: () => {},
    module: {
      exports: {},
    },
    ...value.exports,
  };

  vm.createContext(context);
  vm.runInContext(value.content, context);
  console.log(context, "YAY");
}

About

module map written in nodeJS

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published