Skip to content
This repository has been archived by the owner on Mar 25, 2018. It is now read-only.

Programmatic access to folders for subset of modules #49

Closed
synthe opened this issue Dec 29, 2015 · 1 comment
Closed

Programmatic access to folders for subset of modules #49

synthe opened this issue Dec 29, 2015 · 1 comment

Comments

@synthe
Copy link

synthe commented Dec 29, 2015

I have the following scenario:

  • install dev dependencies (gulp, gulp-zip)
  • install regular dependencies (http-proxy)
  "dependencies": {
    "http-proxy": "^1.12.0"
  },
  "devDependencies": {
    "gulp": "^3.9.0",
    "gulp-zip": "^3.0.2"
  }

I have to bundle my application code, as well as the http-proxy module, into a zip file in order to upload to my server (eg. aws lambda, or my server doesn't have internet access).

I don't want to zip up all 140 directories inside of node_modules when creating my deployment package. Instead, I want to only zip up my application code, http-proxy, and http-proxy's dependencies (eventemitter3, requires-port).

Is there a programmatic way to query npm in order to return an array of folders based on an array of modules?

In this example:
getFoldersFor(['http-proxy']) -- or something --
where it would return:
['http-proxy', 'eventemitter3', 'requires-port']
so I could then only zip up those 3 folders into my application's deployment package (zip).

bundledDependencies looks like it is only for npm publishing, so that probably won't work directly.

With npm2, this was easy, as everything was nested. With npm3, there's no documented way of doing this.

Thanks!

@synthe synthe changed the title Programmatic access to folder for subset of modules Programmatic access to folders for subset of modules Dec 29, 2015
@synthe synthe closed this as completed Dec 29, 2015
@synthe
Copy link
Author

synthe commented Dec 29, 2015

wrong repo, sorry

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant