Socket
Socket
Sign inDemoInstall

node-codein

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    node-codein

NodeJS Console Object Debug Inspector


Version published
Weekly downloads
1
Maintainers
1
Install size
674 kB
Created
Weekly downloads
 

Readme

Source

NodeJS Console Object Debug Inspector

Or simply node-codein (longtail for SEO) is supposed to do what Webkit Inspector's Console does. Except this works exclusively with NodeJS.

Screenshot

NodeJS Console Object Debug Inspector

License

Released under MIT License (included)

Minimum requirements

NodeJS v0.8.0+, Chrome 19.xx.xxxx.xx+, Win XP+

Deployment instructions

  1. Install the package via "npm install node-codein", then include it in your script with require("node-codein"); alternatively
  2. Download the package, put it somewhere you can find it
  3. In your script add require("path/to/folder/node-codein")
  4. Run nodejs
  5. Start %localappdata%/Google/Chrome/Application/chrome.exe --app=http://localhost:55281
  6. <li>Make sure you only use Chrome. It might work on something else but going straight with Chrome will save you time.</li>
    

Main features

  • Displays objects in tree format, with expand/collapse controls
  • Executes arbitrary code
  • Wraps the common logging functions: console.log(), console.info(), console.warn() & console.error()
  • Wraps unhandled exceptions via process.on('uncaughtException', ...)
  • Broadcasts messages to all connected clients
  • Reconnects automatically

Visible and hidden features

  • Top buttons:
    • enable iScroll (click-drag to scroll/pan)
    • theme switcher (dark seems to attract the ladies lol :D)
    • YAND.info (Node's API docs)
    • Node's twitter
  • Middle thin bar:
    • drag to resize
    • double click to hide input area
  • Bottom row - left:
    • hide/show input area
    • clear all messages
    • automatically expand objects (just first level)
    • structure object levels + row highlighter
    • input preservation (for spammers)
  • Bottom row - right:
    • expand + collapse every single visible object
    • reload (alias for F5)
    • duplicate window (opens all the messages in it; uses $.clone() so some controls might be inherited from the parent window)
  • Not-so-obvious features:
    • saves last 50 command in local storage, use arrow keys to navigate through previous commands
    • typing suggestions and autocomplete
    • double-click a property name in the message window to insert it
    • shit+enter for new lines
    • tab key indents

Known bugs

Lots of them. Because I had to took a day off from work to build this, so there's was no time to organize nor bughunt.

  • Console log may not pass through every now and again or so. I planned on using EventSource but it wasn't working (maybe buffering instead of flushing, I don't know, can't WireShark locally). So what it does is it keeps connections in a waiting state and when it gets something, it writes and closes those connections. Then clients are supposed to connect back.
  • Autocomplete spams your server. Lag is in place and can be tweaked but it'll basically chop-off words when you hit enter.
  • iScroll + expand all + ctrl+f to find properties will lock the whole browser; not sure why, don't care much, just disable iScroll if you're using this tecnhique to find properties.
  • Autocomplete may not appear after using left / right arrow keys or escape. This is intentional, those 3 keys are GTFO master keys, but if you want the list of suggestions back, type some gibberish and press backspace.
  • The whole source code is haywired.

FAQ

  • What's wrong about the regular console?
    Its overall buffer size, no syntax coloring, hard to use, no direct input, so forth. If you're familar to webkit's "Inspect Element" console tab, you'll see the differences.
  • Then what's wrong with Eclipse's V8 Debugger?
    A debugger is something totally different. Well not really but you still need to set breakpoints, stop executions, scope variables, etc. Plus you have to restart Node to put code in. I can make more excuses if necessary.
  • Why not just fix node-inspector?
    I tried. I first tried to pass back stringified objects and decode them in the local console. The problem was that there was a hardcoded limit of 80 characters beyond which the string turned into "str... (length: 2219)". I'm not sure where this came from but I believe it was built into v8 when it was compiled with Node. I also tried fixing the 0:0:0 (context:scope:handle) but it seemed to pass back blank values no matter what. I didn't had time for that.
  • Can you help me do X / can you add X / can you fix X?
    I'll do everything that doesn't take more than 5 minutes to do. I'm really in a time crisis, but even if I wasn't, I'm highly capitalistic about all my work.

Fork, pull, push, drag, chop, send, fax whatever you want you're free to do it.
Good luck buddy.

- ketamynx

Keywords

FAQs

Last updated on 30 Jun 2012

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc