Is there a way to store projects/modules on AWS S3 and do an npm install
from a client project?
I've found a way to do an npm install
from BitBucket in the npm docs [Go]
I'm trying to find different ways to store common project items (i.e. methods or other resources) to use across microservices.
Instead organize your files in S3 where index. html is the root and files with paths such as js/ css/ images/ taken from the root folder. Note: Its important to understand that you cannot run NodeJS in S3 and instead you will be using the internal web hosting from S3 to serve the static content.
According to the documentation, you should be able to install a package from any url resolving to a gzipped tarball.
So if you expose your bucket content with cloudfront, it should work.
A package is:
- a) a folder containing a program described by a package.json file
- b) a gzipped tarball containing (a)
- c) a url that resolves to (b)
- d) a @ that is published on the registry with (c)
- e) a @ that points to (d)
- f) a that has a "latest" tag satisfying (e)
- g) a git url that, when cloned, results in (a).
doc : https://docs.npmjs.com/about-packages-and-modules#about-packages
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With