New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open Mancy as management for specific node.js app #105

Closed
timnew opened this Issue Mar 3, 2016 · 7 comments

Comments

Projects
None yet
3 participants
@timnew
Copy link

timnew commented Mar 3, 2016

I have looking for solution in node.js world as Rails Console in Ruby on Rails world.

In some time, we might want to do some temporary diagnosis or management task for node app(such as express web server that connected to db/redis other resources)

In this scenario, I want to run some snippet based on my app logic.
Such as instantiating a business model with some hand-writing values and then saving it into database.

I tried to do it in node.js REPL, but so far, it isn't a fancy experience at all.
Then I found Mancy could be an excellent candidate for this kind of scenario.

The only requirement is that I can require modules and files from specific folder, and start mancy from terminal:

e.g.

I wish to launch Mancy in this way:

> mancy path/to/my/cool/app

After Mancy started, I wish to run following code:

require('./initEnv')
import User from './models/User'

await User.forge({ username: 'timnew', password: 'aSecretNoOneKnows '}).save()
@princejwesley

This comment has been minimized.

Copy link
Owner

princejwesley commented Mar 3, 2016

@timnew Added path support from process argument. Use mancy -p path

Usage: mancy [options]

Options:
  -d, --debug     Run in debug mode  [boolean]
  -e, --editor    REPL or Notebook(experimental) mode.
                  Allowed values:
                    'repl', 'notebook'

  -j, --js-flags  js flags for nodejs.
  -l, --lang      Scripting language.
                  Allowed values:
                    'js', 'javascript', 'babel'
                    'ts', 'typescript'
                    'ls', 'livescript'
                    'coffee', 'coffeescript'

  -m, --mode      REPL mode (applicable only for --lang=js).
                  Allowed values:
                    'magic', 'sloppy' or 'strict'

  -p, --path      Add npm path(s) with path delimiter
  -s, --script    Start up script file to load.
  -t, --theme     Editor theme.
                  Allowed values:
                    dark', 'light'

  -h, --help      Show help  [boolean]

@mcendon

This comment has been minimized.

Copy link

mcendon commented Apr 26, 2016

It doesnt work
(on Ubuntu 15.10 i didnt try in other platform)

@princejwesley

This comment has been minimized.

Copy link
Owner

princejwesley commented Apr 26, 2016

@mcendon Which command line option is not working? I'll try to set up and test it.

@mcendon

This comment has been minimized.

Copy link

mcendon commented May 6, 2016

Hi @princejwesley , no one is working... i've try -h, --help, --debug, and others and nothing happens, only the mancy gui is showed...
I always get the same behavior in all cases

Maybe you can try with the --help or -h command option first to test it

SO: Linux 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

@princejwesley

This comment has been minimized.

Copy link
Owner

princejwesley commented May 6, 2016

@mcendon Very sorry. I'll fix this issue.

Here is an ugly work around: (ignore the first option)

$ mancy . --help
$ mancy . -h
@princejwesley

This comment has been minimized.

Copy link
Owner

princejwesley commented May 6, 2016

@mcendon Try npm version: 3.0.0-1. Fixed here

@mcendon

This comment has been minimized.

Copy link

mcendon commented May 6, 2016

@princejwesley thank you!!! , it works now :)

can you please see this? #124

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment