🚀 Launch Week Day 5:Introducing Immutable Scans.Learn More →
Socket
Book a DemoInstallSign in
Socket

@gunshi/definition

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gunshi/definition

utilities for gunshi command definition

latest
Source
npmnpm
Version
0.27.5
Version published
Weekly downloads
3
-90.32%
Maintainers
1
Weekly downloads
 
Created
Source

@gunshi/definition

Version InstallSize JSR

utilities for gunshi command definition

This package exports the bellow APIs and types.

  • define: A function to define a command.
  • lazy: A function to lazily load a command.
  • Some basic type definitions, such as Command, LazyCommand, etc.

[!TIP] The APIs and type definitions available in this package are the same as those in the gunshi/definition entry in the gunshi package. This package is smaller in file size than the gunshi package, making it suitable for use when you want to reduce the size of the node_modules in your command you are creating.

đź’ż Installation

# npm
npm install --save @gunshi/definition

## pnpm
pnpm add @gunshi/definition

## yarn
yarn add @gunshi/definition

## deno
deno add jsr:@gunshi/definition

## bun
bun add @gunshi/definition

🚀 Usage

You can define the gunshi command as JavaScript module with using define, defineWithTypes, lazy and lazyWithTypes

The bellow example case which is using define:

import { define } from '@gunshi/definition'

/**
 * define `say` command as javascript module
 */
export default define({
  name: 'say',
  args: {
    say: {
      type: 'string',
      description: 'say something',
      default: 'hello!'
    }
  },
  run: ctx => {
    return `You said: ${ctx.values.say}`
  }
})

About details, See the below official docs sections:

©️ License

MIT

Keywords

gunshi

FAQs

Package last updated on 24 Dec 2025

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