Coder Social home page Coder Social logo

repl-client's Introduction

REPL Client (rc)

REPL client with tab completion and history. A simple, npm installable alternative to netcat (nc) and socat.

Install

npm install -g repl-client

Usage

$ rc /tmp/repl/socket.io.sock

Adding a REPL to your app.

To easily add a REPL to your Node.js app, use replify.

Compatibility

repl-client only works under node 0.10. Upgrade.

Use cases

As a repl

rc /tmp/repl/hello.sock
hello> require('os').type()
'Linux'

Using stdin pipe

echo "require('os').type()" | rc /tmp/repl/hello.sock
hello> require('os').type()
'Linux'
hello> %

Props

  • Special thanks to @TooTallNate for all the work he's done in improving node's REPL.
  • The starting point for this module was Nate's "full featured" REPL client: https://gist.github.com/2209310
  • We have been using this at @Voxer and love it.

License

(The MIT License)

Copyright (c) 2012-2014 Daniel D. Shaw, http://dshaw.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

repl-client's People

Contributors

dshaw avatar mhmeadows63 avatar vvo avatar

Stargazers

Roman avatar Cat  avatar GAURAV avatar Alexander Pushkov avatar M Haidar Hanif avatar BJR Matos avatar Shia avatar Andy Edwards avatar Angus H. avatar BRADLEY THOMAS SERBU avatar ADoyle avatar  avatar Loïc Mahieu avatar devin ivy avatar Offirmo avatar thadclay avatar John Oliva avatar Dan MacTough avatar Christian Vaagland Tellnes avatar juno suárez avatar Danny Gershman avatar Elliot Chong avatar Nelson Neves avatar Claudio Procida avatar mvecchio avatar Nicolas Clerc avatar rguerreiro avatar Ivan Kotelnikov avatar Alexandru Vlăduţu avatar Glenn Jones avatar Remy Sharp avatar John Weis avatar Jason Lee avatar Andy Davies avatar

Watchers

 avatar Dave Winders avatar James Cloos avatar  avatar

repl-client's Issues

exit using CTRL-D leaves STDIN in raw-mode

One possible fix might be:

--- repl-client.js~     2014-03-25 05:35:55.000000000 +0000
+++ repl-client.js      2018-10-12 16:26:58.984608789 +0000
@@ -41,6 +41,8 @@
 process.stdin.on('data', function watchForEOT(buffer) {
   if (buffer.length === 1 && buffer[0] === 4) { // EOT (end-of-transmission) Ctrl-D
     console.log() // provide graceful line break
+    if (process.stdin.setRawMode)
+      process.stdin.setRawMode(false)
     process.stdin.emit('end')
   }
 })

name of the executable

This tool is nice. We use it at work. A now departed colleague set it up.

However, not knowing that and seeing that 'repl-client' was never referenced in the code, I suppressed the dependency.

A month later, we struggled to understand to what some rarely-used production procedures were refering to while trying to access the cryptic rc...

A search of "node rc" on google returned a LOT of misleading stuff.

I humbly suggest to rename "rc" to "repl-client" to avoid such confusion. It would be clearer and coherent with the package name. 9 chars is nothing compared to precious time wasted.

Thanks !

Doesn't work for Node 0.10.x

_stream_readable.js:694
throw new Error('Cannot switch to old mode now.');
^
Error: Cannot switch to old mode now.
at emitDataEvents (_stream_readable.js:694:11)
at ReadStream.Readable.resume (_stream_readable.js:679:3)
at Socket. (/Users/alexandruvladutu/.nvm/v0.10.3/lib/node_modules/repl-client/repl-client.js:40:17)
at Socket.EventEmitter.emit (events.js:117:20)
at Object.afterConnect as oncomplete

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.