logoalt Hacker News

MrBuddyCasinotoday at 2:21 AM2 repliesview on HN

Java‘s Maven never had them, never felt a need for them.

What is their purpose in JS land?


Replies

tuananhtoday at 2:51 AM

native modules. nodejs can have native modules (written in C++, Rust, etc...). Projects usually ship prebuilt natives binaries (for each arch/OS/Nodejs ABI combination) hosted on GitHub Releases and download them automatically at installation time; fallback to build from source if not found. that's where scripts are used

the reason for not bundling all native binaries is becasue the no. of combinations are huge and it can make module size hundreds of MBs

show 2 replies
dgoldstein0today at 2:28 AM

Off the top of my head the purposes I've seen for them: - building native bindings (node-sass) - asking for funding (core-js)

... Probably a few more but the native case is probably the biggest and the packages I'm using nowadays ship precompiled blobs in optionalDependencies. Install scripts seem to be out of favor.