# python-clickjs

> JS port of fabulous Python click argument parsing library

Latest version **0.0.2** (published 2019-04-01) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install python-clickjs
pnpm add python-clickjs
yarn add python-clickjs
bun add python-clickjs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2019-04-01 |
| First published | 2019-04-01 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 40.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ales Saska |
| Maintainers | alessaska |

## Links

- npm: https://www.npmjs.com/package/python-clickjs
- npm.io page: https://npm.io/package/python-clickjs

## Dependencies (8)

- [@babel/core](https://npm.io/package/@babel/core.md) ^7.3.4
- [@babel/node](https://npm.io/package/@babel/node.md) ^7.2.2
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.4.2
- [@babel/polyfill](https://npm.io/package/@babel/polyfill.md) ^7.4.0
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.3.4
- [@babel/plugin-transform-runtime](https://npm.io/package/@babel/plugin-transform-runtime.md) ^7.4.0
- [@babel/plugin-proposal-decorators](https://npm.io/package/@babel/plugin-proposal-decorators.md) ^7.3.0
- [@babel/plugin-proposal-class-properties](https://npm.io/package/@babel/plugin-proposal-class-properties.md) ^7.3.4

## Recent versions

- 0.0.2 (latest) — 2019-04-01

## README

# clickjs
JavaScript port of famous Python click library for argument parsing



### Table of Contents
* [Installation](#installation)
* [Usage](#usage)
* [Documentation](#documentation)
* [Dependencies](#dependencies)
* [License](#license)

### Installation
Install the package npm:
```console
$ npm install clickjs --save
```

Alternatively if you are using yarn:
```console
$ yarn add clickjs
```


## Enabling decorators

**TypeScript**

Enable the compiler option `experimentalDecorators` in `tsconfig.json` or pass it as flag `--experimentalDecorators` to the compiler.

**Babel 7.x:**

Install support for decorators: `npm i --save-dev @babel/plugin-proposal-class-properties @babel/plugin-proposal-decorators`. And enable it in your `.babelrc` file:

```json
{
    "presets": ["@babel/preset-env"],
    "plugins": [
        ["@babel/plugin-proposal-decorators", { "legacy": true}],
        ["@babel/plugin-proposal-class-properties", { "loose": true}]
    ]
}
```

**Babel 6.x:**

Install support for decorators: `npm i --save-dev babel-plugin-transform-decorators-legacy`. And enable it in your `.babelrc` file:

```json
{
    "presets": ["es2015", "stage-1"],
    "plugins": ["transform-decorators-legacy"]
}
```

**Babel 5.x**

```json
 {
   "stage": 1
 }
```

Probably you have more plugins and presets in your `.babelrc` already, note that the order is important and `transform-decorators-legacy` should come as first.


### Usage

```javascript
import Click from 'clickjs';

@Click.group()
class Command{
    @Click.command("2")
    @Click.argument("value")
    @Click.argument("value2")
    evaluate2(params){
        console.log("command run 2()")
        console.log(params);
    }

    @Click.command("1")
    @Click.option("name")
    @Click.option("name2", {default: '12'})
    evaluate1(params){
        console.log("command run 1()");
        console.log(params);
    }
}

@Command.group("3")
class SubCommand{
    @Click.command("2")
    evaluate2(params){
        console.log("command run 3-2()");
        console.log(params);
    }

    @Click.command("1")
    @Click.option("name")
    @Click.option("name2", {default: '12'})
    evaluate1(params){
        console.log("command run 3-1()");
        console.log(params);
    }
}

new Command().run();
```

### License
This code has been released under the [Apache 2.0 License](LICENSE).

---
_Source: https://npm.io/package/python-clickjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
