News for hackers. Stuff that matters.
Re:50% of new NPM packages are spam by phkahler on Thursday March 30, 2023 @10:37AM (#35373341)
>> I wish they did reviews, but if half of the NPM packages are spam, that's still 172.000 legitimate NPM packages - per WEEK. That's not feasible to review.

It's also not feasible that many of then are good.

Maybe packages should sit in a "new" state until a few reputable (not going to define that) projects make use of them or in some way recommend them.

Re:50% of new NPM packages are spam by com2kid on Thursday March 30, 2023 @12:04PM (#35374885)
For people who are lazy, one of the easiest ways to get code reuse in Node, especially if writing a package in TS that needs to be compiled, is to push it to NPM and import it in another project.

Now days there are other, better, ways to do this, but for beginner and intermediate engineers, if you have some code in one Typescript repo, and you want to import/use it as a JS module in another repo, publishing to NPM is an obvious way to do this.

Re:50% of new NPM packages are spam by Hackbraten on Thursday March 30, 2023 @12:19PM (#35375137)
Which better ways are you referring to?
Re:50% of new NPM packages are spam by bdcravens on Thursday March 30, 2023 @01:24PM (#35376166)
Install from GitHub directly is probably the simplest.
Re:50% of new NPM packages are spam by slaymaker1907 on Thursday March 30, 2023 @07:43PM (#35380421)
It's really important for long term projects to keep access to all dependencies. Package lock files only guarantee that your inputs are still correct but they do not guarantee your inputs will still be around in 10 years.
Re:50% of new NPM packages are spam by com2kid on Friday March 31, 2023 @03:54PM (#35392604)
Falls apart for typescript projects if js files aren't also committed and the package.json setup properly to export the JS code as a module.

Installing from GH directly can also fall apart when fancy built scripts are in place that have to be ran to create actual useful code. :(

Re:50% of new NPM packages are spam by squidsoup on Thursday March 30, 2023 @02:06PM (#35376754)
monorepos/workspaces presumably
Re:50% of new NPM packages are spam by com2kid on Thursday March 30, 2023 @06:58PM (#35380027)
npm link can be used to work on dependencies locally.

To install directly from GH, you can commit the compiled typescript into github, that will allow you to NPM install directly from GH.