r/javascript • • May 10 '19

GitHub Package Registry

https://github.com/features/package-registry
242 Upvotes

47 comments sorted by

24

u/i_ate_god May 11 '19

So this is pretty cool, but if I have to start adding a repository URL for every dependency, I'm going to be very annoyed.

12

u/choonggg May 11 '19

Vim plugins uses this format which works quite well.

Plug "user/repo"

8

u/habanerocorncakes May 11 '19

Npm uses that too actually, but only when installing deps.

npm i userName/repoName

1

u/i_ate_god May 11 '19

yes, user/repo points to a single plugin.

Github is offering you your own NPM repository, to host multiple modules. By the looks of it, its OSS competitors are things like Artifactory and Nexus.

1

u/bladefinor May 11 '19

And Verdaccio

1

u/i_ate_god May 11 '19

well, Verdaccio I believe is just an npm repository. Github will support numerous package managers.

5

u/status_quo69 May 11 '19

It's a bit awkward because you can't mix and match your registries, but you can create a .npmrc file with the following line:

registry="https://blahblahblahgithub.com"

Where this is awkward is if github doesn't have the same package listing as npm does. But hopefully they figured out a good way around that whole issue

2

u/craga89 May 11 '19

You can point individual scopes (e.g. @babel) to different registries using .npmrc, so you can consume specific packages from GitHub that are under your scope (username), but all others from the official NPM registry.

https://stackoverflow.com/questions/32633678/is-there-any-way-to-configure-multiple-registries-in-a-single-npmrc-file

1

u/[deleted] May 11 '19

Most package registries allow you to set an upstream but I don't think this will.

You can set up namespaces in your npmrc though

2

u/[deleted] May 11 '19

Come on it's actually not that bad. I used to do this with private repo dependencies. It's not like you have that many dependencies to specify where specifying a full URL vs username/package could be a big deal. A lot of times you are just going to copy paste the URL anyway.

67

u/habanerocorncakes May 11 '19 edited May 11 '19

Reposting my comment about this from r/node/

This is fascinating to me. Github could never have done this without Microsoft, and developers would never have adopted this if Microsoft did it.

Currently NPM (the company) has a business model which relies mainly on selling to enterprise customers (surely not all their business, but most likely the bulk).

Microsoft is the best poised company in the market to eat their lunch, because enterprise is Microsoft’s core competency. Think what you will of the company and its relevancy today, but they have deep experience selling to enterprise, and preexisting relationships with many enterprises.

What does Microsoft hope to get from this though? Surely its a small line of business, and wont make Github all that much money. Github has a relationship primarily with individual developers first and foremost, that is their target market. Those devs influence their employer’s decision to pay for GitHub because the devs want to use what they’re familiar with. So that relationship with individual devs is really Github’s bread and butter.

Well, I think thats exactly what Microsoft hopes to get; that virtuous cycle of making a product that is loved and widely adopted by individuals and then championed by by those individuals within their organizations. Similar to Slack’s growth model, and also Zoom’s.

Its no secret Microsoft is trying to win back the common developer. At a time when apple is fumbling on caring about devs (re: escape key), and AWS has become the default for cloud production, there is a real opportunity to be the company that makes development better for devs. If Microsoft ever wants to succeed in Cloud, they need to win back developers by having services which are genuinely better and friendlier to use. If they can become the default choice for developers in certain areas (VSCode, Github) and then make it dead simple to integrate with their cloud services, thats a compelling reason for individuals to use their services. And if its actually better (clearly no one is a delighted by the AWS interface) then Azure could become some folks preference for their personal work. And with those services being available where your company already hosts its code and does it developing, Github, then all the better.

Microsoft made a very smart move acquiring Github, and I think they will take great care not to upset the common developer as that is the lifeblood of this whole cycle.

Note, I said common developer. There is a lot of mistrust of Microsoft among the Hacker News and silicon valley crowd. There are definitely valid concerns held by folks at the upper percentile of developers, who tend to both take a longer view and are more cynical (to put it nicely). But thats not the vast majority of devs. Most devs don’t work at FAANG, or live somewhere on the west coast. Most work at smaller companies around the world. Github/Microsoft only need to appeal to most devs.

I wasn’t sure what Microsoft would do to capitalize on their Github acquisition. But this is a great start. There is a lot of drama around npm the company, and their interests are no longer aligned with the common developer. There really are problems there that Github can solve.

GitHub can afford to prioritize the common dev with Microsoft’s help. GitHub already has a great reputation in the open source community, and they are certainly a safer bet for longevity and keeping your package publicly available than npm.

Anyway, I’ve been reading too much Stratechery it seems!

TLDR; This is npm the company’s current business model. Microsoft is way better at enterprise than almost anyone, certainly npm the company. npm’s interests are no longer aligned with common devs, but GitHub’s certainly are and Microsoft is willing to pay to make sure it can stay that way.

Also note: NPM is really at least 3 things. The package registry, which is a public database of all the packages in the JS ecosystem. The website frontend to find packages. The npm cli, which is an open source project. And lastly npm, Inc the company, founded in 2014, who foots the bill for the public registry. I love the npm ecosystem and the people who build the tools, but Im not so hot on the company, since they are essentially rent seeking.

65

u/i_ate_god May 11 '19

Its no secret Microsoft is trying to win back the common developer.

And it's working.

Typescript, Visual Studio Code, .NET 5, building Edge around Chromium, buying GitHub and now this Artifactory/Nexus like offering...

All great things

Though, historically, this is the embrace/extend portion of the embrace/extend/extinguish business model ;)

14

u/habanerocorncakes May 11 '19

Only time will tell. Consolidation is a huge issue because who knows what innovation we wont see due to catch and kill (facebook is great at that) style acquisitions and companies getting lazy or founders losing control after big acquisitions. Nobody yet knows how to handle that, if it should be regulated and how.

But why would microsoft want to kill github? It is the social network they failed to build. In a post windows-dominated world, what better way to stay relevant with developers than this?

1

u/QueenUnicorn4Dayz May 12 '19

Don't forget the new Terminal

4

u/[deleted] May 11 '19

16

u/aN00bDude May 11 '19

Microsoft strategy is working, we really are forcing our employers to use the Microsoft "stack", VS as the default editor, enterprise github for remote version control repo, .NET core for services and our choice of framework for frontend was Angular only for the reason because of TS. After a long time MS products finally gets the work done for developers (Their new shell emulator is just around the corner)

4

u/[deleted] May 11 '19

I’m currently moving a Python project to Azure from AWS. You don’t even need to use .NET to leverage what MS is doing.

Azure registries, the VSCode extensions, pipeline support for all of this...

They’re doing good work. And it just keeps getting better.

1

u/TheBeliskner May 11 '19

We started a node project early last year. Around April time we evaluated AWS and Azure having never hosted an application in the cloud let alone on a PaaS model. Eventually chose Azure because it was so damn simple and easy to use, Route 53 Vs Traffic Manager was probably the biggest contrast at the time.

We had some issues with memory management on Linux App Service caused by Kudu because it was so new and it took a while to sort but they got there and kept in contact. We've had other issues but their support team always seem to be on it and super responsive. Would definitely choose Azure again.

2

u/habanerocorncakes May 11 '19

I had forgotten that TypeScript was a Microsoft project! Thanks for the reminder.

12

u/nenegoro May 10 '19

This is so cool!

6

u/orebright May 10 '19

RIP npm

10

u/Sauloxd May 10 '19

Yeah, they cant even manage their staff properly, imagine going against a behemoth like github!

6

u/scottydoge May 10 '19

But doesn't this build off of npm?

19

u/timdorr May 11 '19

It just uses the npm registry API. You can use yarn or pnpm as your client for an npm-free experience.

0

u/[deleted] May 11 '19

[deleted]

3

u/habanerocorncakes May 11 '19

Well dont underestimate the power that being the default has. Most will likely use npm because its bundled with Node, and there is very little benefit to making the effort to switch from the default which gets everything done to a tool with a slightly different api but equivalent features.

1

u/saadq_ May 10 '19

To be clear, GitHub isn’t launching a competitor to tools like npm

14

u/habanerocorncakes May 11 '19

Npm is a tool, but npm, Inc is the company that runs the public and free package registry. This will supplant npm, Inc but not the open source npm cli tool.

1

u/cokeplusmentos May 11 '19

EILI5

10

u/Max_Stern May 11 '19

Microsoft is taking over the world.

-1

u/MirLivesAgain May 11 '19

It'd be neat if you could clone from Github and have it run npm/yarn install at the same time. So the same download grabs both your project and dependencies.

9

u/theDarkAngle May 11 '19

i mean, it's just one more command lol

0

u/[deleted] May 11 '19

[deleted]

1

u/bladefinor May 11 '19

git clone blah && cd blah && npm install

-6

u/B3zo0 May 11 '19

I see that everyone is excited about this, but please tell me why would I bother with this when the packages are already in npm?

-8

u/jevon May 11 '19

What does it cost?

GitHub Package Registry is free for all repositories during the beta.

Unfortunately that means we won't be able to try it until it's out of beta... Will it be free? $/month? $$$/month? Enterprise sales/month?

9

u/icedbacon May 11 '19

From their blog:

It will always be free to use for open source

1

u/mcncl May 11 '19

You can try it, if you sign up to the Beta (the landing page offers this).

-39

u/license-bot May 10 '19

Thanks for sharing your open source project, but it looks like you haven't specified a license.

When you make a creative work (which includes code), the work is under exclusive copyright by default. Unless you include a license that specifies otherwise, nobody else can use, copy, distribute, or modify your work without being at risk of take-downs, shake-downs, or litigation. Once the work has other contributors (each a copyright holder), “nobody” starts including you.

choosealicense.com is a great resource to learn about open source software licensing.

21

u/itsafuckingtrap1 May 10 '19

At least the bot tried

6

u/[deleted] May 10 '19

Bad bot

2

u/slykethephoxenix May 11 '19

Akiramenaide little one.

0

u/Thought_Ninja human build tool May 11 '19

Bad bot.

-4

u/dominic_rj23 May 10 '19

Product placement?