npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

grok-video-generator

v1768377.239.270

Published

Professional integration for https://supermaker.ai/blog/grok-ai-video-generator-the-ultimate-guide-to-creating-ai-videos-2025/

Readme

grok-video-generator

A JavaScript library for programmatically generating videos from various media sources. Simplifies video creation workflows with an intuitive API.

Installation

bash npm install grok-video-generator

Usage Examples

Here are a few examples showcasing the capabilities of grok-video-generator.

1. Creating a video from a sequence of images: javascript const { VideoGenerator } = require('grok-video-generator');

async function createImageVideo() { const generator = new VideoGenerator({ outputFile: 'image_sequence_video.mp4', frameRate: 30, });

const imagePaths = [ 'path/to/image1.jpg', 'path/to/image2.jpg', 'path/to/image3.jpg', ];

for (const imagePath of imagePaths) { await generator.addImage(imagePath); }

await generator.finalize(); console.log('Image sequence video created successfully!'); }

createImageVideo();

2. Adding audio to an existing video: javascript const { VideoGenerator } = require('grok-video-generator');

async function addAudioToVideo() { const generator = new VideoGenerator({ outputFile: 'video_with_audio.mp4', inputVideo: 'existing_video.mp4', });

await generator.addAudio('path/to/audio.mp3');

await generator.finalize();
console.log('Video with audio created successfully!');

}

addAudioToVideo();

3. Generating a video from text using a text-to-speech service (example using a placeholder service): javascript const { VideoGenerator } = require('grok-video-generator');

async function generateVideoFromText() { const generator = new VideoGenerator({ outputFile: 'text_to_video.mp4', width: 1280, height: 720, frameRate: 30, });

const text = "This is a sample video generated from text.";

// Assume 'textToSpeechService' is a function that converts text to an audio file path. // This is a placeholder - you'll need to integrate with a real TTS service. const audioFilePath = await textToSpeechService(text);

await generator.addAudio(audioFilePath);

// Optionally add a background image or color. await generator.addBackgroundImage('path/to/background.jpg');

await generator.finalize(); console.log('Video from text created successfully!'); }

// Placeholder text-to-speech function (replace with a real implementation) async function textToSpeechService(text) { // In a real application, you would use a text-to-speech API here. // For example: Google Cloud Text-to-Speech, Amazon Polly, etc. console.log(Simulating text-to-speech conversion for: ${text}); return 'path/to/generated_audio.mp3'; // Replace with the actual path }

generateVideoFromText();

4. Overlaying text onto a video: javascript const { VideoGenerator } = require('grok-video-generator');

async function overlayTextOnVideo() { const generator = new VideoGenerator({ outputFile: 'video_with_text.mp4', inputVideo: 'existing_video.mp4' });

await generator.addTextOverlay({
    text: 'Hello, World!',
    startTime: 2, // Start at 2 seconds
    duration: 5, // Display for 5 seconds
    x: 100,
    y: 100,
    fontSize: 48,
    color: 'white'
});

await generator.finalize();
console.log('Video with text overlay created successfully!');

}

overlayTextOnVideo();

API Summary

  • VideoGenerator(options): Constructor for the VideoGenerator class.
    • options: An object containing configuration parameters.
      • outputFile: (required) The path to the output video file.
      • inputVideo: (optional) The path to an existing video to use as a base.
      • frameRate: (optional, default: 30) The frame rate of the output video.
      • width: (optional) The width of the output video. If not specified, it will be determined by the input video or images.
      • height: (optional) The height of the output video. If not specified, it will be determined by the input video or images.
  • addImage(imagePath): Adds an image to the video.
    • imagePath: The path to the image file.
  • addAudio(audioPath): Adds an audio track to the video.
    • audioPath: The path to the audio file.
  • addTextOverlay(options): Adds a text overlay to the video.
    • options: An object containing the text overlay configuration.
      • text: The text to display.
      • startTime: The time in seconds when the text overlay should start.
      • duration: The duration in seconds for which the text overlay should be displayed.
      • x: The x-coordinate of the text overlay.
      • y: The y-coordinate of the text overlay.
      • fontSize: The font size of the text.
      • color: The color of the text.
  • addBackgroundImage(imagePath): Adds a background image to the video.
    • imagePath: The path to the background image file.
  • finalize(): Finalizes the video generation process and saves the video to the specified output file. Returns a Promise.

License

MIT

This package is part of the grok-video-generator ecosystem. For advanced features and enterprise-grade tools, visit: https://supermaker.ai/blog/grok-ai-video-generator-the-ultimate-guide-to-creating-ai-videos-2025/