Giter Site home page Giter Site logo

vantage-es6-contextified-repl's Introduction

Vantage REPL - ES6 & Context

NPM

Build Status code coverage code style code style: prettier made with lass license

Table of Contents

Install

npm:

npm install vantage-es6-contextified-repl

yarn:

yarn add vantage-es6-contextified-repl

Usage

import Vantage from 'vantage'
import repl from 'vantage-es6-contextified-repl'
import chalk from 'chalk'
import figlet from 'figlet'

new Vantage()
  .use(repl, {
    delimiter: chalk.red('repl:'),
    description: 'Server REPL with access to app and db objects !',
    banner: 'Have fun !',
    context: { infos, app, db },
    formatter: 'highlight'
  })
  .banner(figlet.textSync('MAIN SERVER'))
  .delimiter(chalk.green('main-server~$'))
  .listen(8080)
  .show()

Options

  • mode - the command to type to enter in REPL mode, default to repl.
  • description - the mode description displayed in help menu, default to Enters REPL mode..
  • banner - the welcome message displayed when entrering in REPL mode, default to: Entering REPL Mode. To exit, type 'exit'.
  • delimiter - the additional delimiter of the mode, default to repl:.
  • timeout - the maximum amout of time to eval the code, default to 15000.
  • context - the REPL context, accessible from evalued code, default to {}.
  • compiler - the code transformation functon, set null or a functon using signature function(code:string) and that returns a string, the default function uses Babel.
  • formatter - the output transformation functon, set highlight, none or a functon using signature function(input:string) and that returns a string, default to highlight.

TODO: Multiline input support

TODO: Make an option to use a custom or predefined theme for highlight formatter

Contributors

Name
Victor Rebiard--Crépin

License

MIT © Victor Rebiard--Crépin

vantage-es6-contextified-repl's People

Contributors

blitzbanana avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.