DoCode

A tool that automatically generates media files, such as videos, GIFs, and screenshots, from your JavaScript sketch file.

The DoCode home page - https://mgs.github.io/docode/

Installation

Requirements

1. Make sure that Node.js is installed on your machine.

Open your terminal and type:

$ node -v

If Node.js is not installed, please go to the Node.js official site and install it.

Make sure that ImageMagick is installed on your machine.

Open your terminal and type:

$ convert

If ImageMagick is not installed, please go to the ImageMagick download page and install it, or type the following command on the terminal:

$ brew install imagemagick

Make sure that ffmpeg is installed on your machine.

Open your terminal and type:

$ ffmpeg

If ffmpeg is not installed, please go to the ffmpeg Mac OS X download page and install it, or type the following command on the terminal:

$ brew install ffmpeg

DoCode Installation (on a Mac)

Install the doCode NPM package globally:

$ sudo npm install docode -g

You might be asked to enter you Mac user password.

Check that doCode was installed correctly:

$ docode

Should return the docode help ✊.

How to use

Generate screenshots from a p5.js sketch

While in the project (sketch) main folder, run the following command:

$ docode screenshots

You can also specify the number of screenshots and the interval between the screenshots in seconds, like this:

$ docode screenshots [number_of_images] [interval]

For example, to receive 30 screenshots with 2 seconds between them, use:

$ docode screenshots 30 2

Generate a GIF from a p5.js sketch

While in the project main folder, run the following command:

$ docode gif

Specify the number of images in the GIF and the interval between them in seconds, like this:

$ docode gif [number_of_images] [interval]

For example, to receive a GIF from 120 images with 0.5 seconds between them, use:

$ docode gif 120 0.5

Generate a video from a p5.js sketch

While in the project main folder, run the following command:

$ docode video

Specify the length of the video in seconds and the interval between images, that will be used to create the video, like this:

$ docode video [length] [interval]

For example, to receive a 24 seconds video that was created from images that were taken in intervals of 1.4 seconds between them, use:

$ docode video 24 1.4

Uninstall (on a Mac)

Use the following command:

$ sudo npm uninstall -g docode

You might be asked to enter you Mac user password.

Contributors

DoCode was built with ❤️ by:

😎 Michael Simpson

🤗 Eric Li

🤠 Alejandro Matamala

😝 Dror Ayalon

With the support of:

Patrick Hebron

Rune Madsen

at NYU ITP

License

You can check out the full license here

This project is licensed under the terms of the MIT license.