Code Monkey home page Code Monkey logo

reptile's Introduction

reptile

hapi plugin for creating a REPL

Build Status

NPM

Lead Maintainer: Wyatt Preul

The following options are available when configuring 'reptile':

  • port - the port to use to connect to the REPL. Defaults to port 9000.
  • localOnly - determines if only traffic from localhost is allowed to connect to the REPL. Defaults to true.
  • context - an object whose properties will be added to the REPL context
  • replOptions - an object whose properties will be passed along to Repl.start

reptile's People

Contributors

arb avatar brandonaaron avatar briandela avatar cjihrig avatar devinivy avatar geek avatar gingermusketeer avatar jaulz avatar lloydbenson avatar marsup avatar nargonath avatar tiagolr84 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reptile's Issues

How to use it?

I am confused on this project, is it a repl console for hapi project?

Peer dependency with hapi disallows v11 and v12

Turns out the change made to resolve #29 wasn't necessary and ended-up breaking usage with hapi v11 and v12 (npm install fails with a peer-dependency error). I feel sure it wasn't intended to be a breaking change. Just reverting the peer deps of hapi from 13.x.x back to >=11.x.x should do the trick!

Functions as context

Can I give the the context a function? Or how am I supposed to let it do stuff other than just returning a string?

Deprecate?

If not, please open a hapi v17 migration issue.

example is outdated

I think example server is outdated.

I have changed it to this variant:

var Hapi = require('hapi');
var Reptile = require('../');


var server = new Hapi.Server();

server.connection({ 
    host: 'localhost', 
    port: 8000 
});

server.register([{ register: Reptile }], function (err) {

    if (err) {
        console.error(err);
        process.exit(1);
    }

    console.log('REPL available on port 9000');
});

server.start(function () {

    console.log('Server started at http://localhost:' + server.info.port);
});

Currently the server starts, but I can not do anything on the port 9000.

image

Does this plugin still supported and wokring? Tried with hapi 10.5.0.

Regards,

Hapi 13 peerDependencies Support?

Hi, we were hoping to upgrade from Hapi 11 to 13 and receive the following error running npm install:

npm ERR! Darwin 15.5.0
npm ERR! argv "/Users/bflad/.nvm/versions/node/v4.4.1/bin/node" "/Users/bflad/.nvm/versions/node/v4.4.1/bin/npm" "install"
npm ERR! node v4.4.1
npm ERR! npm  v2.14.20
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants hapi@>=11.x.x

The peerDependencies are currently too strict to support both 11 and 13:

"peerDependencies": {
  "hapi": ">=11.x.x"
},

I noticed you already have 13.x.x in the devDependencies, are you planning on cutting a release with 13 support? Please let me know if you need any help testing or upgrading. Thanks!

[email protected] missing 'lib' folder

When downloading the latest release of Reptile (3.0.0) from npm, I've noticed the tarball is missing the lib folder when downloaded.

$ curl -O `npm --registry=https://registry.npmjs.org/ info reptile dist.tarball`
$ tar xf reptile-3.0.0.tgz
$ ls ./package/
total 24
-rwxr-xr-x  1 scott  scott  1655 Jan  6  2017 LICENSE*
-rw-r--r--  1 scott  scott   756 Jan  6  2017 README.md
-rw-r--r--  1 scott  scott   672 Nov 16 16:29 package.json

It looks like the version published somehow missed the lib folder, so when you require('reptile') it doesn't work.

Allow the context for the repl to be extended

Unless i am mistaken this module does not allow for the context of the repl to be customized.

I would like to be able to add some helper functions to do things like printing out a routing table etc

Is this intentional or would a PR that allows this to happen be welcome?

2.0.0 Release Notes

Version 2.0.0 marks the move to reptile only supporting node version 4 and 5 as well as hapi 11. If you are using a previous version of hapi you should use the 1.x.x version of reptile.

Getting 'TypeError: Cannot read property 'get' of undefined' when trying to connect

Trying to use reptile with Hapi 7. I add the plugin and it registers correctly (I'm using the default settings). However, when I try to connect I get the following error TypeError: Cannot read property 'get' of undefined from this line var context = Hoek.applyToDefaults({ socket: socket, pack: pack }, options.context || {});

This is the extended stacktrace (from longjohn):

/Users/brian/farmstr/website/node_modules/longjohn/dist/longjohn.js:185
        throw e;
              ^
TypeError: Cannot read property 'get' of undefined
    at exports.clone (/Users/brian/farmstr/website/node_modules/hoek/lib/index.js:67:31)
    at exports.clone (/Users/brian/farmstr/website/node_modules/hoek/lib/index.js:71:41)
    at exports.clone (/Users/brian/farmstr/website/node_modules/hoek/lib/index.js:71:41)
    at exports.clone (/Users/brian/farmstr/website/node_modules/hoek/lib/index.js:71:41)
    at exports.clone (/Users/brian/farmstr/website/node_modules/hoek/lib/index.js:71:41)
    at exports.clone (/Users/brian/farmstr/website/node_modules/hoek/lib/index.js:71:41)
    at exports.clone (/Users/brian/farmstr/website/node_modules/hoek/lib/index.js:71:41)
    at exports.clone (/Users/brian/farmstr/website/node_modules/hoek/lib/index.js:71:41)
    at exports.clone (/Users/brian/farmstr/website/node_modules/hoek/lib/index.js:71:41)
    at exports.applyToDefaults (/Users/brian/farmstr/website/node_modules/hoek/lib/index.js:152:24)
---------------------------------------------
    at new Server (net.js:923:10)
    at exports.createServer (net.js:75:10)
    at exports.register (/Users/brian/farmstr/website/node_modules/reptile/lib/index.js:22:22)
    at internals.Pack._plugin (/Users/brian/farmstr/website/node_modules/hapi/lib/pack.js:455:21)
    at /Users/brian/farmstr/website/node_modules/hapi/lib/pack.js:261:14
    at iterate (/Users/brian/farmstr/website/node_modules/hapi/node_modules/items/lib/index.js:35:13)
    at done (/Users/brian/farmstr/website/node_modules/hapi/node_modules/items/lib/index.js:27:25)
    at /Users/brian/farmstr/website/node_modules/tv/lib/index.js:117:16
---------------------------------------------
    at internals.Server._init (/Users/brian/farmstr/website/node_modules/hapi/lib/server.js:344:19)
    at internals.Server._start (/Users/brian/farmstr/website/node_modules/hapi/lib/server.js:304:10)
    at /Users/brian/farmstr/website/node_modules/hapi/lib/pack.js:564:14
    at iterate (/Users/brian/farmstr/website/node_modules/hapi/node_modules/items/lib/index.js:35:13)
    at exports.serial (/Users/brian/farmstr/website/node_modules/hapi/node_modules/items/lib/index.js:38:9)
    at internals.Pack._apply (/Users/brian/farmstr/website/node_modules/hapi/lib/pack.js:562:11)
    at /Users/brian/farmstr/website/node_modules/hapi/lib/pack.js:530:18
    at /Users/brian/farmstr/website/node_modules/hoek/lib/index.js:642:22

Any ideas?

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.