Socket
Book a DemoInstallSign in
Socket

ANSIdom

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ANSIdom

a quick and dirty DOM implementation in ANSI escape codes

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

ANSIdom v0.0.1

a quick and dirty DOM implementation in ANSI escape codes

share templates between the browser and the terminal

note: the current DOM implementation is a hack, at best. expect it to break, badly.

Installation

 npm install ANSIdom
 
 

Usage

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);

});

Examples

see: /bin/ folder for some demos

MIT

FAQs

Package last updated on 27 Oct 2011

Did you know?

Socket

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