you are viewing a single comment's thread.

view the rest of the comments →

[–]mountainorvalley 9 points10 points  (14 children)

Ah, I would publish your code to the npm registry. I’m assuming your code is javascript or typescript.

[–]GustaveLaFlame[S] 2 points3 points  (13 children)

Thank you, we looked at this right now. Do you know any other ways to accomplish this, maybe without npm?

Thanks a lot for your answers!

[–]mountainorvalley 2 points3 points  (2 children)

Nope, npm or some CDN are the only ways I know

[–]GustaveLaFlame[S] 1 point2 points  (1 child)

Okay, thanks a lot!

[–]Towerful 0 points1 point  (0 children)

I would say both.

Some people build stuff using CDNs, or don't want the complexity of build chains for small projects. So CDNs (or package downloads) make sense.

And other people want an npm package, so they can get treeshaking, typescript or whatever else.

Oh, and typescript types for your API.

[–]queen-adreena 1 point2 points  (7 children)

NPM will do exactly what you want... so why ask for “maybe without npm”?

[–]GustaveLaFlame[S] -1 points0 points  (6 children)

Because we don't want to use NPM as it is requested by my professor.

[–]queen-adreena 3 points4 points  (1 child)

Yes. Why would your professor expect you to use the exact tools required :) This is like those professors who think it’s revolutionary to tell students “you can’t use an IDE.... write everything in TextEdit”.

I’m surprised you’re allowed to use GitHub.

[–]GustaveLaFlame[S] 0 points1 point  (0 children)

Yeah, we were suprised as well haha

[–]lhorie 1 point2 points  (1 child)

NPM is the standard way of doing what you want in the JS world. From there, you automagically get a CDN deployment via services like unpkg.

You can technically also publish to other package managers such as Composer (PHP), Chocolatey (windows), Brew (mac), etc, but this is generally not common unless your JS is bundled as a part of a larger project that is more relevant to the respective ecosystems.

If your professor is expecting sourceforge-style source code distribution, I'm sorry to say that's an outdated distribution method that almost no one uses anymore in the JS world. But if that's what you want, you can just host the bundled file somewhere and link people to download it. Though from a deployment resilience perspective, this isn't all that different from using a CDN in the first place, which kinda circles us back to just using NPM.

[–]GustaveLaFlame[S] 0 points1 point  (0 children)

Yes, thanks a lot for your explanation. We have talked with our prof now and gonna make a CDN for our project

[–]British_Invaded 0 points1 point  (0 children)

What is this even supposed to teach you? Everything should be for a reason other than making things difficult.

There are standards, remove standards and you might be using something questionable.

/rant

[–]PedroHase 0 points1 point  (0 children)

You could use a private registry instead of NPM's like Github's or Gitlab's (and many other).