Socket
Socket
Sign inDemoInstall

cli-cmd-ast

Package Overview
Dependencies
1
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cli-cmd-ast

CLI command ast parser manipulate program bash powershell generic agnostic.


Version published
Maintainers
1
Created

Readme

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

FAQs

Last updated on 22 Feb 2023

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc