mantoni / consolify Goto Github PK
View Code? Open in Web Editor NEWTurn your browser window into a console and run Node modules via Browserify
License: MIT License
Turn your browser window into a console and run Node modules via Browserify
License: MIT License
This looks like a great project, but I'm puzzled by the output when trying to generate a simple page.
$ npm install browserify consolify
$ echo "console.log('hello')" > hello.js
$ browserify --plugin consolify hello.js > hello.html
$ cat hello.html
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
console.log('hello')
},{}]},{},[1]);
That's the same output I get when bundling without the consolify plugin. It looks like listener.then
is not getting called. Before digging any further, I thought I'd check if I was missing something obvious.
just a fyi
Files produced by consolify are not compatible with IE8. I have discovered 2 problems which cause this, but probably there could be more.
Use https://www.npmjs.org/package/brout to improve console compatibility with node and also support stdio.
The open question here is how to deal with color codes and cursor move escapes.
It seems travis-ci.org is shut down ("Since June 15th, 2021, the building on travis-ci.org is ceased. Please use travis-ci.com from now on.") so CI is currently broken for consolify. CI will need to be moved to travis-ci.com or another system to continue working.
Add optional support for Shimify.
$consolify --shimify tests.js > tests.html
it would be cool if I could do this:
var consolify = require('consolify')
consolify()
console.log('hi')
and then browserify that code and run it in a browser to get 'hi' written to the console. it would have to redirect console.log, console.error, console.info to the rendered console, and insert CSS + the console output into the and (through https://www.npmjs.org/package/insert-css maybe)
this is similar to how https://www.npmjs.org/package/console-log works, but I like the formatting in this module better, and the existing CLI use case is cool too
Please ๐
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.