npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@reiniiriarios/newver

v1.1.0

Published

A silly little script to help quickly update a version in package files, then commit, tag, and push.

Downloads

13

Readme

🔥 newver

latest version downloads types: Typescript build

A silly little script to help quickly update a version in package files, then commit, tag, and push. Useful when, like me, you use tagged releases and push versions manually and frequently.

Getting Started

npm i --save-dev @reiniiriarios/newver

package.json:

{
  "scripts": {
    "bump": "newver --commit=true"
  }
}
npm run bump 1.2.3

CLI Usage

newver <version> [options]
newver 1.2.3
newver 1.2.3 -c
newver 1.2.3 --commit
newver --commit 1.2.3
newver 1.2.3 --commit=true --tag=false --push=true --prefix="chore(release)"
newver -cptx "chore(release)" 1.2.3
newver 1.2.3 --files=path/to/file.ext --files=path/to/another/file.ext
newver --files=path/to/file.json --data-paths=package.info.version 1.2.3

For option details:

newver --help

Example output

$ newver -ct --prefix=chore(release) 1.0.3
Updating version to 1.0.3
▸ package.json updated
▸ package-lock.json updated
▸ git add package.json package-lock.json
▸ git commit -m "chore(release): update version to 1.0.3"
[main 999def8] chore(release): update version to 1.0.3
 2 files changed, 3 insertions(+), 3 deletions(-)
▸ git tag v1.0.3
▸ Push to origin? (Y/n) y
▸ git push
To https://github.com/reiniiriarios/newver.git
   2dba8e8..999def8  main -> main
▸ git push origin v1.0.3
To https://github.com/reiniiriarios/newver.git
 * [new tag]         v1.0.3 -> v1.0.3
$ newver --commit=false 1.0.0
Updating version to 1.0.0
▸ Version 1.0.0 is older than version 1.2.3 in package.json. Proceed? (Y/n) y
▸ package.json updated
▸ Version 1.0.0 is older than version 1.2.3 in package-lock.json. Proceed? (Y/n) y
▸ package-lock.json updated

Script Usage

#!/usr/bin/env node
import newver from "@reiniiriarios/newver";

newver(process.args.pop(), {
  commit: true,
  prefix: "chore(release)",
  ignoreRegression: false,
  files: ["package.json", "package-lock.json", "path/to/another/file.json"],
});

Supported data formats

  • .json
  • .yaml / .yml
  • .toml

Other formats are find-and-replace.

Supported auto-magical files

These will be looked for automatically in the project's root directory. Other files may be specified manually.

  • package.json
  • package-lock.json
  • Cargo.toml
  • snapcraft.yaml
  • tauri.config.json
  • wails.json
  • go.mod