I'm trying to get the list of files from a local package that would be published by npm. The best solution I've come by is to use
npm publish --dry-run
through child_processes.spawn(...) or a related method.
However, this is not very reliable as I need to parse the text output that is not guaranteed to be/stay the same in all environments/future releases.
Of course, I could npm pack and list the contents of the tarball, but that is rather outside the scope of my project, as for instance I wouldn't want to rely on being able to write to the filesystem.
So, is there a "semantic" way to access the data returned by npm publish?