Skip to content

Latest commit

 

History

History
66 lines (37 loc) · 2.79 KB

CONTRIBUTING.md

File metadata and controls

66 lines (37 loc) · 2.79 KB

Contributing

Jump in the pit and add something new!

Adding a Mode

By adding a new mode, you will be creating a new file which exports a function that manipulates data extracted from a source image's bitmap. That may sound like a lot, but it'll essentially come down to basic iteration over a buffer. Starter code has been provided here.

Experimenting

Your mosh mode doesn't have to do anything specific -- if you think it's cool, we probably will too. Use your imagination and feel free to experiment!

Most of Datamosh's current modes overwrite existing Red/Green/Blue (RGB) pixel values with something random. If you get stuck or just need some inspiration, check out these examples.

Once you have a stub function and some cool name for it, you'll want to import it into Datamosh.

To import your mode, you have two options:

  1. Import it into Datamosh by adding an entry in mosh.MODES, here. (Preferred)
  2. Add it to the function property after you initialize Datamosh. Example code on how to do this can be found here.

Getting Started

  1. Fork datamosh and run npm install within the directory.

  2. On your fork, create a new branch named username/work-description, where username is your GitHub username and work-description is a short description for your contribution.

    For example: mster/new-mode

  3. Commit your work to the branch you created.

  4. When you're ready for review or to submit your contribution, double check a few things.

  • ✓ First, make sure your fork is up to date. If your fork is out of date, you will need to rebase.

  • ✓ Next, assure that your code pases npm test.

  1. If you contribution is more than a single commit, squash all commits into one.
  2. Open a pull request to mster:master.

Other Features

Have an feature in mind? Go for it -- if we like it, we will add it.

Follow the Getting Started guide if you're new to this.

Code Style

Datamosh uses StandardJS. To have your contributions accepted, they must also be in StandardJS style.

To test if your code passes, run the test command: npm run lint

Testing

As of v1.0.0, tests consist of:

  • linting using StandardJS

Need Help

We're happy to help out, no matter how small. Open an issue, ping the author (@mster), or join the Discord.

Datamosh has a dedicated Discord server. Feel free to join: https://discord.gg/DhYTmMD