Swap-Aggregator-Subgraph/node_modules/gluegun/docs/toolbox-meta.md
Richa-iitr d211083153 Revert "Revert "added handler""
This reverts commit c36ee8c5ca.
2022-07-03 07:30:05 +05:30

1.0 KiB

Provides functions for accessing information about the currently running CLI. You can access this on the Gluegun toolbox.

src

The currently running CLI's source folder.

toolbox.meta.src // "/Users/jh/Code/gluegun"

version

Retrieves the currently running CLI's version.

toolbox.meta.version() // '1.0.0'

packageJSON

Retrieves the currently running CLI's package.json contents as an object.

toolbox.meta.packageJSON()
// { name: 'gluegun', version: '9.4.2', ... }

checkForUpdate

Async function that checks NPM to see if there's an update to the currently running CLI.

const newVersion = await toolbox.meta.checkForUpdate()
// false (if none exists)
// '9.4.3' (new version if exists)
if (newVersion) {
  toolbox.print.info(`New version available: ${newVersion})`)
}

commandInfo

Retrieves information about all of this CLI's commands. You can use this to display a custom help screen, for example.

const commandInfo = toolbox.meta.commandInfo()
toolbox.print.table(commandInfo)