From cd2ea559a3db073d46130b3491dd51c5ff27dcad Mon Sep 17 00:00:00 2001 From: Joshua Koo Date: Sun, 30 Oct 2016 12:36:35 +0800 Subject: [PATCH] Update package changes --- README.md | 14 ++++++++++++-- package.json | 14 +++++++++++--- play.js | 3 ++- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 22fa7de..2b1c022 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,13 @@ This is an example of how you can run three.js in your terminal. Sysadmins can now run three.js in remote ssh sessions! +### Install and Running + +``` +npm i -g threejs-term +threejs-term +``` + ### Features - Shows off using three.js in node based environments. - Terminal / ASCII based rendering @@ -13,11 +20,13 @@ Sysadmins can now run three.js in remote ssh sessions! ### Internals This is built with some awesome libraries. - [three.js](https://github.com/mrdoob/three.js/) - Duh! -- [blessed](https://github.com/chjj/blessed) - Loads of terminal goodies! -- [node-canvas](https://github.com/Automattic/node-canvas) - Canvas emulation on node.js +- [blessed](https://github.com/chjj/blessed) - Loads of terminal goodness! +- [node-canvas](https://github.com/Automattic/node-canvas) - Canvas emulation on node.js ### Development +Play with the [source](https://github.com/zz85/threejs-term/blob/master/play.js) + Install dependencies ``` yarn install # or npm install @@ -30,6 +39,7 @@ node play.js It's tricky to debug blessed apps (since console.log's gonna messup the terminal), so I'll pipe console.error messages to a log file and tail it elsewhere. +log() helper function can also be used. ``` node play.js 2>> logs.txt diff --git a/package.json b/package.json index 5aba4c6..176ba35 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,19 @@ { - "name": "three-blessed", + "name": "threejs-term", "version": "1.0.0", - "main": "index.js", + "main": "play.js", "license": "MIT", + "bin": { + "threejs-term": "play.js" + }, + "scripts": { + "start": "node play.js" + }, "dependencies": { "blessed": "^0.1.81", + "blessed-contrib": "^4.5.5", "canvas": "^1.6.1", "three": "^0.82.1" - } + }, + "url": "https://github.com/zz85/threejs-term" } diff --git a/play.js b/play.js index a1aa6a7..9a793c4 100644 --- a/play.js +++ b/play.js @@ -1,3 +1,5 @@ +#! /usr/bin/env node + THREE = require('three'); Canvas = require('canvas'); @@ -6,7 +8,6 @@ require('three/examples/js/renderers/SoftwareRenderer'); require('three/examples/js/renderers/CanvasRenderer'); require('three/examples/js/controls/TrackballControls'); -// require('./track'); const fs = require('fs');