Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Manually set require.cache #13

@ORESoftware

Description

@ORESoftware

Might use this lib, but I have a question. If we do

require('./package.json');

then the require.cache object will be set for this path.

however, if we do:

const requirefs = require('require-from-string');

fs.readFile('./package.json', function(err,data){
    requirefs(data);
});

will the require.cache be set?

it's not clear from the docs and my guess is no. But maybe the Module constructor takes care of that? Not sure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions