node2nix VS bundlers

Compare node2nix vs bundlers and see what are their differences.

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
node2nix bundlers
4 3
486 89
- -
0.0 2.8
6 months ago 7 months ago
Nix Nix
MIT License MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

node2nix

Posts with mentions or reviews of node2nix. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-06-26.
  • The Magic Nix Cache
    9 projects | news.ycombinator.com | 26 Jun 2023
    You may find something like node2nix helpful (https://github.com/svanderburg/node2nix). This converts your package.json into a Nix expression that can then be cached. You're right that it does require some setup and a bit of Nix knowledge but could yield significant benefits and take a good chunk out of that 20 minutes.

    Another option might be to use pnpm instead of Yarn and cache your pnpm dependencies. pnpm actually works a bit like Nix in that it creates a pnpm-lock.yaml file with content-based hashes for the full package.json dependency tree. This enables it to quickly determine which parts of the dependency tree it needs to build and which are already available.

  • Override `nodePackages' with the `default.nix' from `node2nix' multiple times
    2 projects | /r/NixOS | 6 Jul 2022
    I got it from this github issue in the node2nix repo.
  • how to install Mozilla's readability library?
    3 projects | /r/NixOS | 30 Dec 2021
    As Gerschtli commented, it may be possible to generate a Nix expression for @mozilla/readability using node2nix. Then get its node_modules path like this and set NODE_PATH to the value.
  • How to install dependencies with Nix?
    3 projects | /r/NixOS | 16 Feb 2021
    For node programs, you may be able to find the commands as just packages, or look at https://github.com/svanderburg/node2nix for creating the nix equivalent of a node-modules

bundlers

Posts with mentions or reviews of bundlers. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-06-26.
  • The Magic Nix Cache
    9 projects | news.ycombinator.com | 26 Jun 2023
    - the caching works across branches, so for example merging a feature branch to master, if nothing changes the build on master will be very quick

    I created something similar to nix-cache for gitlab, but I had to create a dedicated runner running NixOS.

    If I could use NixOS for deployment, at that point I would just point the same binary cache to the machine and use the same derivation to build the app. Because the app was already build by CI, it would just download the compiled version. No need for artifactory or similar. In that scenario (you using poetry) you probably would just use poetry2nix to generate the application.

    If the OS is not NixOS, but you still want to deploy via nix, then IMO this[2] looks interesting, basically it packages everything in self extracting archive. That you can extract and then run the app.

    Other alternatives are these bundlers[3], which includes building toArx (works in a way similar to the previous one but pretends everything is in a single file), RPM, DEB, docker (you would have more control over it if you would use the code directly instead of a bundler though)

    And the last option (probably the most obvious one) is that you can simply just use the tool to build the package. Since you're using poetry, then you can generate a wheel from it.

    [1] https://github.com/takeda/nix-cde/blob/master/contrib/gitlab...

    [2] https://github.com/Ninlives/relocatable.nix

    [3] https://github.com/NixOS/bundlers/blob/master/flake.nix

  • After 20 years are developers now ready for Nix?
    1 project | news.ycombinator.com | 2 Mar 2023
    We've seen the opposite. New package managers are built with a much better understanding of the problem space because of Nix and sometimes explicitly taking ideas and concepts. This results in those new systems being far more compatible and easily integrated with Nix itself. Consider the iteration towards better and better locking in python + Node. Consider Rust/Cargo.

    There has also been sharing of ideas and collaboration between things us and bazel/buck/spack/etc. I think it is clear that we are all moving towards a similar end state, that often looks very much like Nix, or a re-invention of it.

    For things like OCI, Nix predates it, but we should start to re-use the standard. The Tvix group is exploring this and I'd suspect our sandboxing will be OCI at some point. For outputs; we make it easy to convert a Nix package into an equivalent container. Things like flatpack,AppImage,Snap should also be easy for people to output (i'm trying to collect these "transformers"/"bundlers" here: https://github.com/NixOS/bundlers).

  • Nixpacks takes a source directory and produces an OCI compliant image
    7 projects | news.ycombinator.com | 17 Aug 2022
    Nix 3 has a dead simple, builtin CLI frontend for built packages: https://nixos.org/manual/nix/unstable/command-ref/new-cli/ni...

    It uses dockerTools: https://github.com/NixOS/bundlers/blob/master/flake.nix

    maybe a bundler can be added that uses OCI tools, thus providing such a wrapper and giving a nice CLI for it

What are some alternatives?

When comparing node2nix and bundlers you can also consider the following projects:

nixpkgs - Nix Packages collection & NixOS

hasql-interpolate

nix-npm-buildpackage - Build nix packages that use npm/yarn

relocatable.nix - A nix bundler that produces relocatable deployment script for nix store paths.

nur-packages - My NUR packages

readability-cli

stage0 - A set of minimal dependency bootstrap binaries

at-node-nix - Node.js Nix expressions