Archive. Date of access: 12 Jan 2022
Marak Squires eec02f9359 [api] Box drawing is now optional | 13 yıl önce | |
---|---|---|
bin | 13 yıl önce | |
lib | 13 yıl önce | |
templates | 13 yıl önce | |
.gitignore | 13 yıl önce | |
ReadMe.md | 13 yıl önce | |
package.json | 13 yıl önce |
share templates between the browser and the terminal
note: the current DOM implementation is a hack, at best. expect it to break, badly.
browser demo http://ohh.io/ANSIdom
terminal demo
curl ohh.io/ANSIdom
these both share the same HTML template
npm install ANSIdom
var ANSIdom = require('../lib/ANSIdom').ANSIdom,
fs = require('fs');
var dom = new ANSIdom();
var template = fs.readFileSync('./templates/index.html').toString();
dom.init(function(err){
if (err) {
throw err;
}
//
// Note: `process` can be any streamable interface, like httpServer.response
//
dom.render(template, process);
});
see: /bin/
folder for some demos