package
Termview is a package that allows you to render images, videos, GIFS, in the terminal.
npm install termviewGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
The TermView package renders images and videos within the terminal.
npm install termviewJust like any package, you need to require termview to use it.
const termview = require('termview');
// Now that termview is imported, you can use "Image, Video, and Gif" functionsThe Image function can be passed up to four parameters.
var render = await termview.Image('./myimage.png')
console.log(render)The Video function can be passed up to four parameters.
await termview.Video('./myvideo.mp4')The Video also has two sub functions. Video.preload and Video.render
The Video.preload function will load the frame data and return an object like the one below.
{
frames: [/* Array of escape codes */],
width: Number,
height: Number,
fps: Number,
}When calling this function, you can pass up to 3 parameters:
The Gif function can be passed up to four parameters.
10)await termview.Gif('./mygif.gif', 100)/* Load the video */
var video = await termview.Video.preload('./myvideo.mp4')
/* render the video */
await termview.Video.render(video);The Video.render function will render previusly loaded frame data.
When calling this function, pass an object in the format of:
{
frames: [/* Array of escape codes */],
width: Number,
height: Number,
fps: Number,
}Example:
/* Load the video */
var video = await termview.Video.preload('./myvideo.mp4')
/*
{
frames: [...],
width: ...,
height: ...,
fps: ...,
}
*/
/* render the video */
await termview.Video.render(video);Estimated unpacked size across 49 packages.
24.2 MB
Includes dependencies.