Giter Site home page Giter Site logo

zenpoint's Introduction

Zenpoint

An open window into your running nodejs code.

This module creates a very convenient REPL session served through the telnet protocol.

Usage example

Place a zenpoint in your code

function mycode(var1, var2, var3) {
    require('zenpoint')({
        listen: 1976,
        inspectDepth: 0,
        persist: false,
        context: {
            var1,
            var2,
            var3,
        },
    });

    // ... do some unrelated work here
    return 42;
}

mycode('zenpoint', 'the debugging helper', 'for zen fellas');

Telnet the Zenpoint server

$ telnet localhost 1976
Trying ::1...
Connected to localhost.
Escape character is '^]'.
πŸ€πŸ§˜πŸ Welcome to the Zenpoint πŸ₯‘πŸ¦πŸ¦
πŸ›πŸžπŸœπŸπŸ¦—βžž mycode (repl:2:17)
πŸ›πŸžπŸœπŸπŸ¦—βžž repl:1:1
πŸ›πŸžπŸœπŸπŸ¦—βžž ContextifyScript.Script.runInThisContext (vm.js:50:33)
πŸ›πŸžπŸœπŸπŸ¦—βžž REPLServer.defaultEval (repl.js:240:29)
πŸ›πŸžπŸœπŸπŸ¦—βžž bound (domain.js:301:14)
πŸ›πŸžπŸœπŸπŸ¦—βžž REPLServer.runBound [as eval] (domain.js:314:12)
πŸ›πŸžπŸœπŸπŸ¦—βžž REPLServer.onLine (repl.js:468:10)
πŸ›πŸžπŸœπŸπŸ¦—βžž emitOne (events.js:121:20)
┏━┫zenuser@zenhost:~/src/zenpoint#[email protected]β”ƒπŸ™ˆπŸ™‰πŸ™Šβ”£β”
β”—>β”«this
{ console: [Getter],
  global: [Circular],
  process: [Object],
  Buffer: [Object],
  clearImmediate: [Function],
  clearInterval: [Function],
  clearTimeout: [Function],
  setImmediate: [Object],
  setInterval: [Function],
  setTimeout: [Object],
  module: [Object],
  require: [Object],
  mycode: [Function: mycode],
  d: [Function],
  inspectOptions: [Object],
  log: [Function],
  cr: [Function: cr],
  stack: 'πŸ›πŸžπŸœπŸπŸ¦—βžž mycode (repl:2:17)\r\nπŸ›πŸžπŸœπŸπŸ¦—βžž repl:1:1\r\nπŸ›πŸžπŸœπŸπŸ¦—βžž ContextifyScript.Script.runInThisContext (vm.js:50:33)\r\nπŸ›πŸžπŸœπŸπŸ¦—βžž REPLServer.defaultEval (repl.js:240:29)\r\nπŸ›πŸžπŸœπŸπŸ¦—βžž bound (domain.js:301:14)\r\nπŸ›πŸžπŸœπŸπŸ¦—βžž REPLServer.runBound [as eval] (domain.js:314:12)\r\nπŸ›πŸžπŸœπŸπŸ¦—βžž REPLServer.onLine (repl.js:468:10)\r\nπŸ›πŸžπŸœπŸπŸ¦—βžž emitOne (events.js:121:20)\r\nπŸ›πŸžπŸœπŸπŸ¦—βžž REPLServer.emit (events.js:211:7)',
  var1: 'zenpoint',
  var2: 'the debugging helper',
  var3: 'for zen fellas',
  frozen: [Object] }
┏━┫zenuser@zenhost:~/src/zenpoint#[email protected]β”ƒπŸ™ˆπŸ™‰πŸ™Šβ”£β”
β”—>β”«

What's in the session

console.log() -> log()

console.log cannot be used because its output goes right to the process' stdout. Instead use the log() function

log('this is this', this);

inspect depth

The depth of the inspection usd by log() can be tuned with the d() function

d(4);

context, frozen and current

The state of the context is frozen at the initialization of the server and can be accessed through the frozen object.

log('frozen state', frozen);
log('current state', {var1, var2, var3});

zenpoint's People

Contributors

ploki avatar

Watchers

 avatar

Forkers

jonathan-annett

zenpoint's Issues

Zenpoint on Glitch

not exactly an issue, just a shout out... as in "hey i'm using zenpoint, and you can too, on glitch"
(there are a few optimizations you might want to incorporate in your repo)

https://glitch.com/edit/#!/glitch-zenpoint-repl?path=README.md

https://github.com/jonathan-annett/glitch-zenpoint-repl

i haven't done a fork, but have credited you in the readme.

things to consider implementing:

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.