Launch Week Day 1: Socket for Jira Is Now Available.Learn More
Socket
Book a DemoSign in
Socket

cli-cmd-ast

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cli-cmd-ast

CLI command ast parser manipulate program bash powershell generic agnostic.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

Cli cmd ast

CLI command ast parser manipulate program bash powershell generic agnostic.

Please note that Cli cmd ast is currently under development and not yet suited for production

Installation

 $ npm i cli-cmd-ast

Usage

import { toAst, toCmd } from "cli-cmd-ast"

let yieldsAst = toAst(`npm "--org  google" cmd --flag --option1 val -v=1.1`)

yieldsAst = {
  cmds: [ 'npm', '--org  google', 'cmd' ],
  args: { flag: true, option1: 'val', v: 1.1 }
}

Note that the order of commands is not preserved, if one command is after a flag, as this information is not part of the ast.

let yieldsCmd = toCmd(yieldsAst)

yieldsCmd = `npm "--org  google" cmd --flag --option1 val -v=1.1`

Contribute

All feedback is appreciated. Create a pull request or write an issue.

Keywords

cli

FAQs

Package last updated on 22 Feb 2023

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