How to generate npmDepsHash using IFD?

I’m trying to use buildNpmPackage which requires an npmDepsHash. Now I’m using this a separate repository to do this so it’s not part of nixpkgs.

Previously when I used node2nix, I could put it into an IFD, so I can just run it.

However now it appears prefetch-npm-deps is impure, and I cannot put it into an IFD.

I want a derivation I can just run directly like nix-build ./release.nix -A application that doesn’t require me to precalculate the prefetch-npm-deps prior. It should just figure it out directly from the ./package-lock.json.

Is there a way to do this?

Plus the command prefech-npm-deps is kind of flaky, it often fails with some DNS resolution problem.