arei / npmbox

Utility for creating (boxing) and using (unboxing) an archive of a complete (including all dependencies) npm install.
MIT License
245 stars 34 forks source link

npm packages with fwd slash = kaboom #86

Closed ricksbrown closed 7 years ago

ricksbrown commented 7 years ago

The following command will cause npmbox to clutch its chest and fall to the ground gasping:

npmbox "@types/chai@3.4.34"

I had the same reaction when I discovered that NPM modules are allowed to include a forward slash in their name 😱

I patched my local install by changing line 343 from this: if (!target) setTarget(npa(source).name); to this: if (!target) setTarget(npa(source).escapedName);

I did not think it through beyond "works for me". Happy to open a PR for that if you like.

arei commented 7 years ago

Yes! Please submit a PR and receive the fabulous reward of our gratitude and free beer if we are ever in the same city at the same time.