carbon-now-cli icon indicating copy to clipboard operation
carbon-now-cli copied to clipboard

Consider dependency changes

Open outslept opened this issue 3 months ago • 1 comments

Hey, I was wondering if you are open to dependency changing PRs?

  1. chalk

This could be replaced by picocolors or ansis - both of which are much smaller and dedupe better

  1. execa

This could be replace by tinyexec - better dedupe as a result.

  1. get-stdin

As per project's README https://github.com/sindresorhus/get-stdin#tip you can now achieve this functionality with Node (and you engines supports this)

  1. file-exists

A tiny helper using fs.access() + fs.stat() should be sufficient.

  1. file-extension

We can "modernize" the code under the hood and use something like

function fileExtension(name = "", { preserveCase = false } = {}) {
  const i = Math.max(name.lastIndexOf('.'), name.lastIndexOf('/'), name.lastIndexOf('\'));
  const ext = name.slice(i + 1);
  return preserveCase ? ext : ext.toLowerCase();
}

Semantics are the same and the code is more readable in my opinion.

  1. lodash

Most of the usage is Object.entries + Object.fromEntries. For .omit it's something like

Object.fromEntries(Object.entries(presetSettings).filter(([k]) => !this.ignoredSettings.includes(k)));

outslept avatar Sep 24 '25 00:09 outslept

Hey @outslept, thanks for the very constructive feedback. 🙂 I’ll consider/implement these changes in the next release, maybe during the holiday season. Appreciate it!

mixn avatar Nov 13 '25 10:11 mixn