Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

menhera

Package Overview
Dependencies
Maintainers
1
Versions
139
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

menhera

an experimental lovely frame

  • 0.4.5
  • npm
  • Socket score

Version published
Weekly downloads
9
decreased by-25%
Maintainers
1
Weekly downloads
 
Created
Source

Menhera

an experimental lovely frame

yarn add menhera
import { EventEmitter } from "events";
import Menhera, { _methods, _data } from "menhera";
import minimist from "minimist";

export const CLI = {
  name: "CLI",
  _data() {
    return {
      structs: {},
      Event: new EventEmitter()
    };
  },
  awake() {
    let { _, ...flags } = minimist(process.argv.slice(2));
    let [command = "*", ...inputs] = _;
    const { h, help } = flags;

    this.Event.emit(command, { inputs, flags });
  },
  _hooks: () => ({
    onCli({ _key, _val, cp }) {
      for (let [key, val] of Object.entries(_val)) {
        const { exec } = val;
        this.structs[key] = val;
        if (exec) {
          this.Event.on(key, exec.bind(cp));
        }
      }
    }
  })
};

const cliTest = {
  name: "clitest",
  onCli: {
    "*": {
      exec() {
        console.log("help");
      }
    },
    test: {
      exec({ inputs, flags }) {
        console.log(inputs, flags);
      }
    }
  }
};

const _ = new Menhera({
  _hooks: () => ({
    _methods,
    _data
  }),
  _mount: {
    cli: [CLI, cliTest]
  }
}).$use({
  _command: {
    run: true
  }
});

FAQs

Package last updated on 05 Apr 2018

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc