vrml1to97/etc/vrml1to97.js
Glen Whitney e0861ea157 feat: install moo and use in toy example (#2)
I failed to find a satisfactory way to compile and import moo.js with
  fixed specifiers, so finally I just gave up and patched the distributed
  moo code to be an es6 module. Very ugly but it works.

Resolves #1.

Reviewed-on: #2
Co-authored-by: Glen Whitney <glen@studioinfinity.org>
Co-committed-by: Glen Whitney <glen@studioinfinity.org>
2023-09-01 21:32:25 +00:00

14 lines
414 B
JavaScript
Executable File

#!/usr/bin/env node
import {convert} from './vrml1to97/index.js'
import {stdin, argv} from 'node:process'
import {streamToString} from './streamToString.js'
if (argv.length > 2) {
console.log('Usage: vrml1to97 < old.wrl > shinynew.wrl')
console.log(' Translates VRML 1.0 on standard input to VRML97 on standard out.')
} else {
const input = await streamToString(stdin)
console.log(convert(input))
}