Is there a way to include two versions of the same dependency in nodejs package.json?
For testing purposes, I need to use two versions of socket.io (one to expose a socket in the latest version and one to simulate a dependency server using an old release).
{
"dependencies": {
"socket.io": "~0.9.0",
"socket.io": "~1.2.0"
}
}
Maybe not the best solution, but you can first fork socket.io 0.9 on github: https://github.com/Automattic/socket.io/tree/0.9
To create https://github.com/youaccount/socket.io/tree/0.9
Then use this:
"dependencies": {
"oldsocket.io": "git+ssh://[email protected]/socket.io.git#0.9",
"socket.io": "~1.2.0"
}
Edit the package.json and rename the name
attribute to oldsocket.io
And you can now require socket.io
or oldsocket.io
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With