- Work in a fork of this repository
- Work in a branch on your fork called
lab-04
- Set up Travis CI on your forked repository
- Open a pull request to your forked repository
- Submit on canvas a question and observation, how long you spent, and a link to your pull request
Configure the root of your repository with the following files and directories. Thoughfully name and organize any aditional configuration or module files.
- README.md - contains documentation
- .gitignore - contains a robust
.gitignore
file - .eslintrc - contains the course linter configuratoin
- .eslintignore - contains the course linter ignore configuration
- package.json - contains npm package config
- create a
lint
script for running eslint - create a
test
script for running tests
- create a
- lib/ - contains module definitions
- __test__/asset/ - contains bitmaps for testing
- __test__/ - contains unit tests
For this assignment you will be building a bitmap (.bmp
) transformer CLI. It will read a bitmap in from disk, run one or more color or raster transforms and then write it out to a new file. This project will require the use of node buffers in order to manipulate binary data. Your solution should be composed of small tested modules that solve specific problems. Your modules should be thoughfuly named and well documented. The entry point to your CLI should be an index.js file in the root of your package, and all helper modules should be placed in your lib/ directory. Your bitmap transformer modules should not use any third party librarys.
- The CLI should be architected using best modularization practices
- The CLI should require at least three arguments
input-file-path output-file-path transfrom-name
- The CLI should support a minimum of four transforms
- The CLI should log useful Error messages if used incorrectly
- The CLI should log a success message on completion
- Use
describe
andtest (or it)
methods to define discriptive tests and increase readablity - Each
test
callback should aim to test a small well defined feature of a function - Write tests to ensure each function behaves correctly with valid and invalud inputs
- The CLI should be tested without using
child_process
or any equivilant third party libraries
Please include your Travis CI build badge at the top of your README. Describe the exported values of each module you have defined. Every function description should include it's arity (expected number of parameter), the expected data for each parameter (data-type and limitations), and it's behavior (for both valid and invalued use). Feel free to write any additional information in your README.md.
You will want to define a strategy for solving the problem before you begin to code. Once you have a strategy defined, you can break it into steps that can be split into helper modules. Each helper module should solve a small specific problem. The main module should utilize the helper modules to execute your original stratagy.
- Gather user input (infile, outfile, and transform)
- Read the input bitmap file using the fs module
- Parse the bitmap's buffer into object represeting a bitmap (using a constructor)
- Using metadata from the parsed bitmap object run a transform on the buffer directly (mutate the color or raster data)
- Write the mutated buffer to the output file path
-
Color Pallet Transforms
- Invert
- Randomize
- Black and White
- Darken or Lighten
- Add or Mutiply a Hue
- Add or Subtract Contrast
-
Raster Data Transforms
- Pixilate
- Add a border
- Add a watermark
- Vertically or Horizontaly Filp
- Verticaly or Horizontaly Mirror
- Verticaly or Horizontaly Stretch