CLI (and node module) which polls the NPM registry until a new package version becomes available. The CLI will exit once a matching release is found, allowing subsequent commands to run.
- Supports private NPM registries (if
npm
can access it, so should this package) -
--exec 'npm install %s'
to inject and run commands on release -
--install
flag to automatically runnpm install $package
on release -
--update
flag to automatically runnpm update $package
on release -
--daemon
to keep listening for new releases (works with--exec
)
npm install -g await-release
await-release [options] <package> [package2@version...]
Package identifiers may optionally include:
- scope (@org/pkg)
- semver version string (pkg@16, [email protected], etc.)
-i, --install execute 'npm install' on release
-e, --exec <command> execute shell command on release (interpolates %p, %s, %t, %v)
-o, --output <format> output format (default/verbose/none/json)
-g, --grace <seconds> accept versions released up to X seconds before invocation (default: 10)
-t, --timeout <seconds> exit if no release matches after X seconds (default: 0)
-d, --delay <seconds> time between polling requests (default: 2)
Other processes can be invoked when a release is discovered using the --exec
option. The provided string will be executed within a basic shell environment
after interpolation of the following placeholders:
%p
: package name (my-package
,@scope/package
, etc.)%s
: package name and version ([email protected]
,@scope/[email protected]
, etc.)%t
: time of release in ISO 8601 format (2020-05-26T22:01:02Z
)%v
: released version (1.0.1
)
await-release my-dependency -i
# or via --exec:
await-release my-dependency --exec 'npm install %s'
await-release package-name --exec "npx -p node-notifier-cli notify -t '%p released %v'"