Craft By Zen

Writing

  • Running ESM on Node REPL
    Posted

    d3 v7 is packaged as ESM only. That made it difficult to use in the Node.js REPL. From this StackOverflow thread, I found a solution.

    let d3;
    import("d3").then((module) => {
      d3 = module;
    });
    // Then you can use d3 anywhere once the promise is resolved.
    
    Filed: 🚰 Stream
  • Package Dependency for @observable/plot
    Posted

    Extremely esoteric bug. I’ve had an open issue for the past three months related to this other issue. I couldn’t figure out why npm’s registry would pull an older version of d3-scale-chromatic when I upgraded the @observable/plot library. As a future note for myself, if I run into this issue again, I’ll have to go into the package-lock.json file and update d3-scale-chromatic to v3.1.0.

    Filed: 🚰 Stream
🔖 Tags