
Company News
AWS Security Hub Adds Socket for Supply Chain Security
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.
@inquirerer/utils
Advanced tools
CLI lifecycle utilities
Utilities for building command-line applications with inquirerer
CLI lifecycle utilities for building command-line applications with inquirerer.
npm install @inquirerer/utils
Extracts the first positional argument from argv for command routing:
import { extractFirst } from '@inquirerer/utils';
const { first, newArgv } = extractFirst(argv);
// first = 'init' (the subcommand)
// newArgv = remaining arguments with first positional removed
Exits the CLI with an error message and optional cleanup:
import { cliExitWithError } from '@inquirerer/utils';
await cliExitWithError(error, {
beforeExit: async () => {
await closeConnections();
}
});
Checks for package updates with caching:
import { checkForUpdates } from '@inquirerer/utils';
const result = await checkForUpdates({
pkgName: '@my/cli',
pkgVersion: '1.0.0',
registryBaseUrl: 'https://registry.npmjs.org'
});
if (result.hasUpdate) {
console.log(result.message);
}
Gets the package.json for the current package:
import { getSelfPackageJson, getSelfVersion, getSelfName } from '@inquirerer/utils';
const pkg = getSelfPackageJson(__dirname);
const version = getSelfVersion(__dirname);
const name = getSelfName(__dirname);
MIT
git clone https://github.com/constructive-io/dev-utils.git
cd dev-utils
pnpm install
pnpm build
cd packages/<packagename>
pnpm test:watch
🛠 Built by the Constructive team — creators of modular Postgres tooling for secure, composable backends. If you like our work, contribute on GitHub.
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
FAQs
CLI lifecycle utilities for building command-line applications
The npm package @inquirerer/utils receives a total of 8,711 weekly downloads. As such, @inquirerer/utils popularity was classified as popular.
We found that @inquirerer/utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.

Research
/Security News
Popular npm packages keyv and cacheable compromised.

Security News
A misconfiguration gave three Anthropic models internet access, and one, believing it was in a simulation, shipped a credential-stealing package to PyPI.