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 🙏

© 2025 – Pkg Stats / Ryan Hefner

withmove

v0.0.2

Published

Create dynamic, data-driven videos on the fly.

Downloads

11

Readme

About

Withmove is a fork of @pankod/canvas2video

Withmove is a simple package capable of creating mp4 videos, directly on Node.js. The core is based on @pankod/canvas2video but with additional features. The package is currently at version 0.0.1, being very unstable and is not recommended for production use.

Use Cases

📺 Personalized video advertising

🎞️ Programmatical customization of video templates

⛅ Creating dynamic videos with real-time data

Getting Started

To install the module, run the following in the command line: npm i withmove

Example

const withmove = require('withmove')

withmove({
    silent: false,
    output: 'hello-world.mp4',
    fps: {
        input: 30,
        output: 30,
    },
}, {
    width: 1920,
    height: 1080,
    fps: 30,
    silent: false
}, (prop, fabric, canvas, anim) => {
    prop(fabric.Text, 'Hello world!', {
        from: {
            left: -100,
            top: 0,
            fontFamily: 'Arial',
            fontWeight: 'Bold',
            fontSize: 100,
            fill: 'white',
        },
        to: {
            duration: 1,
            left: 0,
            ease: 'power1.in' // ease from gsap
        }
    })
}).then(() => console.log('Video successfully rendered'))

Usage

withmove itself is a function(promise), expecting three arguments: 2 config objects and 1 callback function. The first argument is the config for the encoder while the second argument being for the renderer. The two config objects are documented below. The callback function will be called with four arguments: prop, fabric, canvas and anim. Basic usage of prop is explaind below:

prop(fabric.Text, 'Hello world!', {
        from: {
            left: -100,
            top: 0,
            fontFamily: 'Arial',
            fontWeight: 'Bold',
            fontSize: 100,
            fill: 'white',
        },
        to: {
            duration: 1,
            left: 0,
            ease: 'power1.in'
        }
    })

With prop, you can add new objects directly to the canvas. The first argument is from fabric, and the new keyword is not required. The second argument is the main argument, which will be directly passed to your fabric class. The third, also the last argument is the config argument, which allows you to set specific configs and also animate easily. Without animations, you may also use as the following:

prop(fabric.Text, 'Hello world!', {
    left: 0,
    top: 0,
    fontFamily: 'Arial',
    fontWeight: 'Bold',
    fontSize: 100,
    fill: 'white',
})

Because withmove is a Promise, you can use the then method to wait for the rendering process.

...}).then(() => console.log('Video successfully rendered'))

Options

Renderer

| Properties | Type | Description | | - | - | - | | width *required | Number | canvas width | | height *required | Number | canvas height | | fps *required | Number | animation fps |

| Parameter | Type | Repo | | - | - | - | | prop | () => { ... } | fabric | fabric.js instance | Repo | | canvas | fabric.StaticCanvas | Repo | | anim | gsap.default.timeline | Repo |

Encoder

| Properties | Type | Description | | - | - | - | | frameStream *required | Readable | renderer function return value | | output *required | string| output file path | | fps *required | Object | { input: number, output: number } | | outputOptions | Array | [ '-preset veryfast', ...] | | backgroundVideo | Object | See below | | backgroundAudio | String | See below |

backgroundVideo

backgroundVideo: {
  videoPath: string, // background video path
  inSeconds: number, // video start time (in seconds)
  outSeconds: number, // video end time (in seconds)
}

backgroundAudio

withmove({
    backgroundAudio: './path_to_file.mp3',
}, { ... }, ...)

Adds a background audio to the output. To limit the length of the original output video to the same length as the background audio, you can set the -shortest options in config.outputOptions.

withmove({
    outputOptions: ['-shortest']
}, { ... }, ...)