Azure web-sites private packages source - node.js

On my project I need to use private packages.
Does azure web sites support publishing project using private packages via npm or other source?

We support npm from private git repo. See this. However, you will have to set up ssh keys (See this). Hope it helps.

Related

Is there a way to use Gemfury in conjunction with packages in Github Packages?

I believe the answer is no, but hoping for something different. =)
I'm experimenting with Gemfury as a provider, and as such moving some private packages into it, but not ready to move all of them. Some of them need to reside in Github Packages for a while longer.
In the mean time, consumers need to be able to install from the regular npm registry, Github Packages and now Gemfury.
public npm + Github Packages -> works
public npm + Gemfury -> works
public npm + Github Packages + Gemfury -> haven't found a way to get this to work
Is this possible? Are there docs or guides on how to accomplish this ultra-blended-index? From https://gemfury.com/help/npm-registry/ I can't derive how to set up the version that combines all 3.
The closest I got to this to working was with the following .npmrc
#ourscope:registry=<<github_packages_url>>
registry=<<gemfury_proxy_url>>
//n<<gemfury_proxy_url>>/:_authToken=${NPM_GEMFURY_AUTH_TOKEN}
engine-strict=true
The above works locally, but doesn't seem to work on CI though
Since I couldn't find any documentation to support it, I'm not even sure if it should be working locally or if it's just a happy accident of sorts.
Any insights on whether this is possible and how to adopt it would be appreciated!

how to create a private registry to host my custom nodejs libraries

I am working on SAP cloud foundry environment(Pass) where its architecture is micro services. So I want to build two application using node and deploy them in SAP cloud foundry platform.
The problem or confusion I am facing is, I have some custom helper code in helper.js file that is very useful in both of my node application and I do not want to keep the same code of helper.js file in both the application. So as a alternative I found the below things
1.create a private package
2.use exports(but this works only for files inside a module and not between modules)
Please help me if there's any other may to do it and if not help me understand on creating private package in npm and how can have my own org/user private registry.

How to upload third party libraries in Nexus NPM Repository?

I have created node application and in my application I am using some third party libraries say for example Express. It all works well without any issues if I install it from https://registry.npmjs.org.
But because of some security reason I don't want to download it from npm registery, Instead I want that it should be downloaded from my private repository ( We are using Nexus OSS as private repository ).
The problem is I am not able to find way to upload Express module in Nexus Registery. I found one way using Npm proxy but for security reasons we can not use it.
Do any one know how to upload third party libraries to Nexus npm Registry?

Renting or hosting a public NPM repository

Say I'm developing a large Node.js framework geared towards a specific market. People would use this framework to write and share their software, just like they would with NPM. The problem is I don't want to pollute the default NPM registry and I also want to control my own. I also want a clean repository where only modules relating to my framework would be stored.
My question, because NPM is flexible enough to let us override the default repository, what are my options for setting up an empty public NPM repository? Is there a managed host I can pay and have them set everything up for me? Is it better to manage it myself? Can I use a service like Digital Ocean or Linode? or perhaps I can just leverage a service like GitHub and bypass NPM altogether?

Can I run a private npm repository without replicating the public repository?

I'm writing a number of pieces of code (for internal use) using node.js and want to store the modules (packaged up for npm) in a package repository for each distribution to the various machines they will be installed on.
Ideally, I'd like a solution similar to Debian's apt repositories in which I can run a private repository server and configure npm to use a list of repositories to install from (When installing "foo", if "foo" is known by my private server install it from there, otherwise install it from the public server).
However, it looks like the npm registry configuration key only accepts a single URL.
Is there a way to achieve what I want?
The closest I've been able to find have been:
Mirroring the public repository locally and adding my packages on top of it… but I don't want to keep that amount of data (2.5G and still downloading) replicated on AWS.
Hosting all my packages in git repositories and installing from there (which is more of a hassle).
Hosting static packages on HTTP (as far as I can tell, this would prevent me from automatically getting "the latest version". I suppose I could do something with symlinks, but that is still less flexible than git, requires full URLs (which need to be kept up to date), and doesn't give a searchable repository.
I just set this up for my work. Here's what I did:
Setup empty NPM registry: I followed the instructions from this fork of npmjs.org, which adds much improved documentation.
Setup Kappa: I used Kappa, a great npm proxy from Paypal. (I'm guessing they have a very similar use case to most people who want a private repository; this was exactly what I wanted).
Setup npm_lazy (optional): I wanted a nice cache of frequently used packages in case npmjs.org went down, so I added npm_lazy in front of the whole thing, as a caching layer.
Whole thing took two days(ish) to get up and running. As a side note, if you're worried about people pushing to the public registry by accident, I recommend adding this to your package.json:
"publishConfig": { "registry": "http://my-registry.example.com" },
This really is just a bit of paranoia; once you setup your npm to point to your Kappa/npm_lazy instance, Kappa handles publishing to your private repository for you.
Note: Kappa will only every publish to the first repository in it's config. If you need to publish to both your private registry, and the public, you will need to work out your own solution.
In your package.json, you can use any url that points to a valid npm packed module. I use an s3 with a bucket name that is hard to guess.
npm pack
s3cmd put *.tgz s3://path-to-your bucket
S3 is just an example, you could use any mean that can place a file on a web server, it can even be protected via basic auth.
I believe Paypal's Kappa project would suit your need.
Here is an article describing Paypal's Kraken project and how Kappa fits in.
I understand it wasn't available at the time of Quentin's question, but perhaps this will be useful for others that come along here.
npm-registry-client GitHub issue #42 lists several ways how to create your own repository mirror. namely:
https://github.com/cnpm/cnpmjs.org
https://github.com/rlidwka/sinopia
https://github.com/rlidwka/sinopia#similar-existing-things
https://github.com/davglass/registry-static
Overall it seems to me that you can get best answers by searching through issues in repositories owned by https://github.com/npm or by asking your question there
Based only on listening to a recent episode of NodeUp (#37?), I think you may want to have a look at irisnpm. From what I remember it's a service which gives you a merged set of the public modules and your own private modules.
As Dominic Barnes suggested, we can replicate only _design documents (CouchDB table schemes)
How to replicate design documents only?
However, it needs to check if some data needed.
You could replicate the modules you need and then write a proxy server which looks for a module in your replication. If a module doesn't exist, it could pipe the request to NPM and return the result from there.

Resources