🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@inquirerer/utils

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@inquirerer/utils

CLI lifecycle utilities for building command-line applications

Source
npmnpm
Version
3.3.9
Version published
Maintainers
1
Created
Source

@inquirerer/utils


CLI lifecycle utilities

Utilities for building command-line applications with inquirerer

CLI lifecycle utilities for building command-line applications with inquirerer.

Installation

npm install @inquirerer/utils

Features

extractFirst

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

cliExitWithError

Exits the CLI with an error message and optional cleanup:

import { cliExitWithError } from '@inquirerer/utils';

await cliExitWithError(error, {
  beforeExit: async () => {
    await closeConnections();
  }
});

checkForUpdates

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);
}

getSelfPackageJson

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);

License

MIT

Development

Setup

  • Clone the repository:
git clone https://github.com/constructive-io/dev-utils.git
  • Install dependencies:
cd dev-utils
pnpm install
pnpm build
  • Test the package of interest:
cd packages/<packagename>
pnpm test:watch

Credits

🛠 Built by the Constructive team — creators of modular Postgres tooling for secure, composable backends. If you like our work, contribute on GitHub.

Disclaimer

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

Package last updated on 28 Jun 2026

Did you know?

Socket

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.

Install

Related posts