Skip to content

A CLI tool to check and update your package.json dependencies to their latest versions.

License

Notifications You must be signed in to change notification settings

austin-raey/bskt

Repository files navigation

bskt

Simple, zero-dependency bite sized (~3kB) package.json dependency updater with the power of bun

Keep your buns steamy with the 🧺 bskt CLI.

### In your shell
### Print the latest dependencies 👀
bunx bskt
npx bskt
pnpm dlx bskt
yarn dlx bskt

### or write them to package.json 📝
npx bskt -w
pnpm dlx bskt -w
yarn dlx bskt -w
bunx bskt -w

### or if you install globally 🌐
npm i -g bskt
bskt

### or save a few keystrokes ⌨️
bun i -g bskt

### or if it is a package.json dependency and `./node_modules/.bin` is in your $PATH 😵‍💫
npm i -D bskt # or without -D
bskt
// or as a script in your package json 📦
{
  "scripts": {
    "some-name-check-deps": "bunx bskt",
    "some-name-update-deps": "bunx bskt -w",
  },
}

📄 About

Usage

bskt is a CLI tool made to quickly update your package.json dependencies to their latest versions.

  • Updates package versions to the latest tag

    The latest tag refers to the version specifier given by the npm registry, and you can see what other tags are available on a given package's "Versions" tab! These can be custom, but it seems latest always refers to whatever the package maintainer will specify as latest non-pre-release version.

  • Retains version specifiers such as ~ ^

  • (Planned) specify the dist-tag targets you wish to update to with --tag i.e. bskt -w --tag="canary,next"

Personally, I find this pairs well if you use exact versions (no ^ ~) in your package.json.

Limitations

bskt only updates package.json dependencies to their latest version, as specified by their latest tag on the NPM registry (or the tags and fallbacks you specify).

For now, the tool was designed explicitly for this purpose. If this does not suit your use case, I'd highly recommend some other tools which can handle updating to scopes you desire, such as major / minor / patch etc.

🔧 Options

Options (denoted by {opt}) can be specified by passing:

  • Most options:

    • -{opt} or --{opt}
    • -{opt} -{opt} or --{opt} --{opt}
    • -{opt}{opt} or --{opt}{opt}
  • -i and -x:

    • These options must be delimited in the args on their own, for example:

      -i=package1 -{otheropts} or --i=package1

      -x=package1 -{otheropts} or --x=package1

    • Also, they can have quotes ' " or none at all:

      -i=package1 or -i='package1' or -i="package1"

      -x=package1 or -x='package1' or -x="package1"

    • Finally, they use , (no space!) to delimit which package names to pass:

      -i=package1,package2,package3

      -x=package1,package2,package3

Usage

### -d, -v: Show more detailed messaging
bskt -d
bskt -v

### -F: Disable color formatting
bskt -F

### -h: Show help message.
bskt -h

### -i: Specify comma `,` delimited list of dependencies to include. Each string is matched against the entire dependency's name. Can include `'` or `"` around the list if you want.
bskt -i=solid # Would include 'solid-js', '@solidjs/meta', 'eslint-plugin-solid' etc.
bskt -i=solid,unocss # Would include 'solid-js', '@solid...', 'unocss', '@unocss/reset', etc.
# Different command formatting, if desired:
bskt -i="solid,unocss"
bskt -i='solid,unocss'


### -w: Write found updates to `package.json`. By default, `bskt` does not do anything to it.
bskt -w

### -x: Specify comma `,` delimited list of dependencies to exclude. Each string is matched against the entire depenency's name. Can include `'` or `"` around the list if you want.
bskt -x=eslint # Would exclude 'eslint', '@typescript-eslint/...', 'prettier-eslint` etc.
bskt -x=eslint,@fortawesome # Would exclude 'eslint', '@typescript-eslint/...', '@fortawesome/fontawesome-...' etc.
# Different command formatting, if desired:
bskt -x="eslint"
bskt -x='eslint,@fortawesome'

✨ Alternatives

bskt was inspired by these other excellent package update managers:

Please check them out! Especially if bskt doesn't fit your use case! 😁