简体   繁体   English

eggjs的命令行功能

[英]Command line functionlity of eggjs

Is it possible to develop commands which run the eggjs framework, so services etc. are available. 是否有可能开发运行eggjs框架的命令,因此可以使用服务等。

For example: 例如:

node bin/egg.js mycommand:start

Therefore I would like to create a "mycommand" class which has access to ctx, services, models etc. 因此,我想创建一个“mycommand”类,可以访问ctx,服务,模型等。

I know this functionality from other frameworks (eg laravel) and it has been very helpful. 我从其他框架(例如laravel)知道这个功能,它非常有帮助。

thank you 谢谢

  • eggjs now support single thread mode, so you could just require and start it. eggjs现在支持单线程模式,因此您只需要启动它即可。
  • or just write a eggjs plugin which expose a REPL 或者只是编写一个公开REPL的eggjs插件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM