Skip to content
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

[idea] mancy for terminal/console #144

Closed
sibelius opened this issue Sep 8, 2016 · 4 comments
Closed

[idea] mancy for terminal/console #144

sibelius opened this issue Sep 8, 2016 · 4 comments

Comments

@sibelius
Copy link

sibelius commented Sep 8, 2016

Mancy idea is really great

But I would like to use it on terminal instead of an electron app

Maybe we could split Mancy in mancy core that could work on both electron app and with terminal based approach

My current approach to have a node repl running my server is like this

import "reify/repl";
import 'isomorphic-fetch';
import 'babel-polyfill';
import REPL from 'repl';
import replPromised from 'repl-promised';
import * as models from './src/models';

(async() => {
  try {
    const info = await connectDatabase();
    console.log(`Connected to ${info.host}:${info.port}/${info.name}`);

    let repl = REPL.start({
      prompt: 'repl > ',
    });
    repl.context.M = models;
    replPromised.promisify(repl);
  } catch (error) {
    console.error('Unable to connect to database');
    process.exit(1);
  }
})();

Instead of replPromised we could use mancy-core to provide all the awesome features of Mancy

@princejwesley
Copy link
Owner

@sibelius I am currently interested in making core node REPL better. Here is a proposal

@sibelius
Copy link
Author

sibelius commented Sep 8, 2016

this would be awesome, but what happens with the older version of node?

can't we try to do both approach?

I don't know if you know ipython (an interactive repl for python)

I think core node REPL should provide the bare minimum, and let other solutions like this one provide extensions

@orionlee
Copy link

Or it could be an NPM that ships with core. In that way,

  • newer nodejs could get it by default
  • while people with older one can still get it
  • it can be updated independently from core update.

@sibelius
Copy link
Author

sibelius commented Jan 6, 2017

I think we can extract a preprocess function from Mancy like this: https://gist.github.com/princejwesley/a66d514d86ea174270210561c44b71ba

from here:

let cook = (plain) => {

and add one node repl

I'll post here, if I create a package or a repo example using this idea

@sibelius sibelius closed this as completed Jan 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants