Figured I would just ask for the abstract basics. Just consider me an amateur noob. I was digging into ComfyUI code to look into integrating or rewriting a script of mine into a custom node for the first time. The source for custom nodes sourced through the ComfyUI node manager have some kind of Yarn package or system. I have no idea what that is or what it is used for and figured it might make a light conversation.

  • @[email protected]
    link
    fedilink
    English
    1311 days ago

    So, there are a lot of words in the post that I’m not familiar with (LoRA, Oobabooga, CivitAI). However, I think those are details about the actual library or package you’re looking at, so I will not touch any of that.

    I can strict answer the question “what is Yarn?”

    Long story short, it’s a direct “competitor” to NPM (Node Package Manager). In the earlier days of Node and NPM, Yarn was an attempt to improve certain weaknesses perceived in NPM (including speed and security). Yarn is still used in many codebases, but it’s become less popular over the years as NPM has resolved many of the things that Yarn sought to fix. Also, Yarn version 2 made a major design change which some have viewed as too radical (though I’m unclear on the details as I’ve only dabbled in v2).

    https://en.wikipedia.org/wiki/Yarn_(package_manager)

    • @kvadd
      link
      49 days ago

      Also, yarn is developed by facebook.

    • @[email protected]
      link
      fedilink
      English
      310 days ago

      yarn was popular because it could be a drop down replacement for npm. Now there must be a lock in to support edge cases most projects don’t need (or know about)?

    • @j4k3OP
      link
      English
      -111 days ago

      deleted by creator

  • @[email protected]
    link
    fedilink
    6
    edit-2
    9 days ago

    Yarn > v1.22 is a very different beast than npm. After that version they introduced a “package-manager” field to package.json and yarn will install the specific version of yarn required by that package onto your root system and use that version.

    There’s probably some way to do that without messing with your root system but after I encountered that I went back to npm. Let something like nix handle the version of my build tool. Or at least install to my home directory like rustup or sbt.

  • @RagingRobot
    link
    410 days ago

    Yarn is a package manager. It lets you install libraries and run scripts for JavaScript.

    If you need to add a library to your project you do something like ‘yarn add react’ for example. That would install react in your project.

    If you write code that needed to be compiled or you wanted to minify it or change it in some way you can also use yarn to help.

  • @shortrounddev
    link
    English
    410 days ago

    It’s like a better version of npm. monorepos work better with yarn