npm.io
1.0.1 • Published 8 years ago

node-three-screenshot

Licence
Version
1.0.1
Deps
2
Size
6 kB
Vulns
1
Weekly
0
Stars
19

node-three-screenshot Build Status

Take a PNG screenshot of a THREE scene

Usage

You will need to install the dependencies for node-canvas.

$ npm install node-three-screenshot
import { toPNG } from 'node-three-screenshot';

fs.writeFileSync('out.png', toPNG(scene));

With Jest

$ npm install jest-image-snapshot
import { toPNG } from 'node-three-screenshot';
import { toMatchImageSnapshot } from 'jest-image-snapshot';

expect.extend({ toMatchImageSnapshot });

expect(toPNG(obj)).toMatchImageSnapshot();