I have searched just about the entire internet for this so I am coming to you with a tough one. How do you spawn a node shell with a custom module pre loaded into it.
Alright, well this has had me going crazy but here is the bit hitch. I am working on a cli tool but would like to piggy back off of nodes shell to use their javascript parser. I would like to have something that starts a node shell with my npm package pre loaded and can be initialized with a file like lets say
$> myModule <fileName>
>
Once that is there I want to be able to run normal inputs like
> let a = 3;
> console.log(a);
3
But also be able to use custom funcitons from my module as well without having to require it into node.
> let a = myCustomeModule.class.function(input)
> console.log(a)
{
some: 'json',
object: {}
}
This is why it needs to pre load it. The issue is I can't seem to find any examples of anyone doing this.
Am I just going about this the wrong way, the main thing is to avoid having to write an entire node cli for this package.