cmd2app
cmd2app - Convert you command line client to electron app. =================
Last updated 2 years ago by l842891024 .
ISC · Original npm · Tarball · package.json
$ cnpm install cmd2app 
SYNC missed versions from official npm registry.

cmd2app - Convert you command line client to electron app.

Install

(sudo) npm install cmd2app -g

How to convert?

  • Complete your command line client.

  • Add some field to package.json to describe your command line client.

    All options as follow example.

    /* package.json */
    {
        "name": "cmd2app example",
        // ...
        "cmd2app" : {
            "repository": "https://github.com/gomeplusFED/meixin-h5-proxy",  // your repo address
            "title": "美信H5 CDN代理模块", // title your want to show
            "bin": ["proxy", "test"], // bin entrance
            "globalOptions": { // global options
                "dir": { // option detail
                    "desc": "the catalog to be proxyed" // option desc
                },
                "port": {
                    "desc": "http portal, default 80"
                },
                "ports": {
                    "desc": "https portal, default 443"
                },
                "foreign": {
                    "desc": "public dependencies path"
                },
                "path": {
                    "desc": "middle path,default /m/app/src"
                },
                "raw": {
                    "desc": "raw path"
                }
            },
            "command": { // command
                "new": { // key
                    "params": [{ //parmas
                        "desc": "repo address" // params desc
                    }, {
                        "desc": "local path"
                    }],
                    "options": { // command options
                        "con": {
                            "desc": "con desc"
                        },
                        "abc": {
                            "desc": "abc desc"
                        }
                    },
                    "desc": "this is test cmd" // command desc
                },
                "test": {
                    "params": [{
                        "desc": "test params"
                    }],
                    "options": {
                        "dir": "the catalog to be proxyed"
                    },
                    "desc": "# create a new app with an official repo"
                }
            }
        }
    }
    

    For example.

    bin + global options

    proxy --dir="/c" --path="/b" --foreign="/a" --port=8011

    proxy -> bin
    dir/path/foreign/port -> global options

    bin + global options + command + command options

    proxy --port=8001 new a b --con=123

    proxy -> bin
    port -> global option
    new -> command
    a -> command params 1
    b -> command params 2
    con -> command option

  • Use cmd2app to build your app.

    (sudo) npm install cmd2app -g
    
    cmd2app new [author/repo] [path]
    
    cd [path] && npm install
    
    electron [path]/src/main/app.babel.js # you should global install electron
    
    Note:
    • Final file not a full app, it's just source code what can run by electron.

    • If you want run your app, you should install electron environment, and use some package tools to package your app, like electron-builder / electron-packager and so on.

    • Also, you can wrap your app further to a plugin for FET. FET is a plugin plataform, you can easily wrap your app to a plugin. More in here

Some images .

  • Main

    main1

  • With all options

    main2

  • Run

    main3

  • Run result

    main4

Current Tags

  • 1.22.0                                ...           latest (2 years ago)

24 Versions

  • 1.22.0                                ...           2 years ago
  • 1.21.0                                ...           2 years ago
  • 1.20.0                                ...           2 years ago
  • 1.19.0                                ...           2 years ago
  • 1.18.0                                ...           2 years ago
  • 1.17.0                                ...           2 years ago
  • 1.16.0                                ...           2 years ago
  • 1.15.0                                ...           2 years ago
  • 1.14.0                                ...           2 years ago
  • 1.13.0                                ...           2 years ago
  • 1.12.0                                ...           2 years ago
  • 1.11.0                                ...           2 years ago
  • 1.10.0                                ...           2 years ago
  • 1.9.1                                ...           2 years ago
  • 1.9.0                                ...           2 years ago
  • 1.8.0                                ...           2 years ago
  • 1.7.0                                ...           2 years ago
  • 1.6.0                                ...           2 years ago
  • 1.5.0                                ...           2 years ago
  • 1.4.0                                ...           2 years ago
  • 1.3.0                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 25
Last Day 0
Last Week 1
Last Month 0
Dependencies (43)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |