New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

test-infer-args

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

test-infer-args

Windmill argument inference utilities

latest
npmnpm
Version
1.0.5
Version published
Maintainers
1
Created
Source

windmill-infer-args

A TypeScript library for inferring arguments from code snippets in various languages for Windmill workflows.

Installation

npm install windmill-infer-args

Usage

import { inferArgs } from 'windmill-infer-args'

// Example schema
const schema = {
	properties: {},
	required: []
}

async function main() {
	// Infer arguments from Python code
	const pythonCode = `
def main(name: str, age: int = 30):
    print(f"Hello, {name}! You are {age} years old.")
  `

	const result = await inferArgs('python3', pythonCode, schema)
	console.log(schema)
	// Output will contain properties for 'name' and 'age' with proper types
	// 'name' will be in the required array since it has no default value
}

main()

Supported Languages

This package supports inferring arguments from code in the following languages:

  • Python (python3)
  • TypeScript/JavaScript (deno, nativets, bun, bunnative)
  • SQL variants (postgresql, mysql, bigquery, snowflake, mssql, oracledb)
  • GraphQL (graphql)
  • Go (go)
  • Bash (bash)
  • PowerShell (powershell)
  • PHP (php)
  • Rust (rust)
  • Ansible (ansible)
  • C# (csharp)
  • Nu Shell (nu)
  • Java (java)

API

inferArgs

Infers arguments from code and populates a schema object with the inferred types.

async function inferArgs(
	language: SupportedLanguage | 'bunnative' | undefined,
	code: string,
	schema: Schema,
	mainOverride?: string
): Promise<{
	no_main_func: boolean | null
	has_preprocessor: boolean | null
} | null>

Parameters:

  • language: The programming language of the code
  • code: The source code to infer arguments from
  • schema: A JSON schema object to populate with inferred types
  • mainOverride: (Optional) Override for the main function name

Returns:

  • An object with information about the parsed code or null if the language is not supported

License

ISC

FAQs

Package last updated on 07 May 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