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

@stepsec/bumper

v5.0.0

Published

Version read/write plugin for StepSec

Downloads

3

Readme

Version read/write plugin for StepSec

This plugin reads and/or writes version/manifest files.

npm install --save-dev @StepSec/bumper

In release config:

"plugins": {
  "@StepSec/bumper": {
    "in": "composer.json",
    "out": "composer.json",
  }
}
  • Use only the in option to read the version from this file in the release process.
  • Use only the out option to write the version that was determined by release to this file.
  • Use both to read and write the version property from/to this file.

The version from the in file will take precedence over the latest Git tag (and the version from package.json if it exists) in release to determine the latest version.

Note that using package.json as out file may conflict with the npm plugin in release. Remove it from the out file(s), or use --npm.allowSameVersion.

The supported file types are:

| Type | Extension(s) | Mime-type | | ---- | ----------------- | ----------------------------------- | | JSON | .json | application/json | | YAML | .yaml or .yml | text/yaml or application-x-yaml | | TOML | .toml | text/toml or application/toml | | INI | .ini | text/x-properties | | TEXT | .txt | text/* |

Explicitly providing the (mime) type takes precedence over the file extension.

The fallback type is text if the file extension and/or type is not known (e.g. index.php).

"plugins": {
  "@StepSec/bumper": {
    "in": {
      "file": "VERSION",
      "type": "text/plain"
    },
    "out": {
      "file": "VERSION",
      "type": "text/plain"
    }
  }
}

To replace all occurences of the current version with the new version in any text file:

"plugins": {
  "@StepSec/bumper": {
    "out": {
      "file": "file.php",
      "type": "text/php"
    }
  }
}

The out option can also be an array of files:

"plugins": {
  "@StepSec/bumper": {
    "out": ["manifest.json", "bower.json"]
  }
}

The out option is parsed with fast-glob, so glob patterns can be used to match files to write to:

"plugins": {
  "@StepSec/bumper": {
    "out": "dist/*.json"
  }
}

The path option (default: "version") can be used to change a different property. The following example will set the current.version property to the new version in manifest.json:

"plugins": {
  "@StepSec/bumper": {
    "out": {
      "file": "manifest.json",
      "path": "current.version"
    }
  }
}

Multiple paths can be provided using an array.

Command-line

Options for this plugin can be set from the command line. Some examples:

StepSec --plugins.@StepSec/bumper.in=composer.json
StepSec --plugins.@StepSec/bumper.out=composer.json --plugins.@StepSec/bumper.out=manifest.json
  • Keys are separated by dots.
  • Values can be negated by prefixing the key with no-.
  • Arguments may need to be single-quoted (') such as --'deep.key=value' or '--deep.key=value'

Depending on your shell or OS this may differ.