Open maddie-j opened 3 years ago
Hi @maddie-j!
I'm not opposed to this, but I think there's already a reasonable workaround. When you add speedscope as a dependency to your package and install it, it will place the speedscope
executable in node_modules/.bin
. So you can then run node_modules/.bin/speedscope
from inside your project without requiring a global installation from end users.
Does that work? The npm bin
command gives you the path to the .bin
directory in case you don't want to rely on that specific path.
Unfortunately node_modules
is no longer accessible after bundling a package into an executable. I understand though that this is a very niche edge-case and 100% get if you don't think it's worth the extra dev effort to support.
Hi @maddie-j This is a very usefully feature that I am looking for. Did you find it out how to import speedscope to open profiles in other applications?
So currently, the only way to import profiles with the speedscope package (as in, programatically and not through uploading to the website) is to first install the
speedscope
package globally and then running from the command line withspeedscope [profile-location]
. However, this makes it difficult to integratespeedscope
with other tools, requiring spawning a subcommand and hoping the person running it hasspeedscope
installed.Is it possible to expose that same functionality from the module so that people can just
import speedscope from 'speedscope'
in their Node code and then be able to do something likespeedscope('profile-location.cpuprofile')
to auto-open the profile?Context: I'm writing a CLI that retrieves a CPU profile (that was generated on a different server) to save and then open locally using
speedscope
. Thing is, I can't expect the end user to havespeedscope
already installed, and it would be much easier to just includespeedscope
as a dependency in thepackage.json
and then callspeedscope
from the code rather than having to spawn a separate process.