Install npm project A which has dependency to project B in project B but use current project B’s index.js file instead of original project B’s version

I have such case:

  1. I created npm project A which has peer dependency to project B
{
  "name": "project-A",
  "peerDependencies": {
    "project-B": "*"
  }
}
  1. I want to test project A inside project B without the need of installing specific version of project B inside project A
  2. I want to install project A inside project B and resolve project A’s dependency to project B’s index.js file which exports all the needed modules.

Is it achievable?

Currently I need to release project A with dependency to specific version of project B and install it like so in project B to test it. Obviously, if there are some changes in project B, project A becomes incompatible.

{
  "name": "project-A",
  "dependencies": {
    "project-B": "1.0.0"
  }
}