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

@tcbox/command-parser

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tcbox/command-parser

Parse nodejs process.argv in to json.

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
0
Created
Source

Command Parser

Parse Command line and process.argv.

Demo

Usage

npm install command-parser

parseCommand

import {parseCommand} from "command-parser";
const commands = parseCommand(`
    node index.js -D |
    npm install
`);

result is

[
  {
    "name": "node",
    "args": [
      "index.js"
    ],
    "options": {
      "D": true
    }
  },
  {
    "name": "npm",
    "args": [
      "install"
    ],
    "options": {}
  }
]

parseArgv

This is only for nodejs

import {parseArgv} from "command-parser";
const command = parseArgv();

CDN

<script src="https://cdn.jsdelivr.net/npm/command-parser"></script>
<script>console.log(window.CommandParser) </script>

Keywords

command

FAQs

Package last updated on 02 Mar 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