handmade
DIY build systems, tooling, and more.
- Small. The API is just 2 methods.
- Simple. A task is just a function that returns a Promise.
- Familiar. Easily write your own tasks using node and the ecosystem.
- Accessible. No complex plugin architecture or file handling.
- Fluid. Functions to the core. Functional in nature.
Getting Started
Install
# via npm $ npm i handmade --save # via yarn $ yarn add handmade
Tasks
A task is a function that manipulates the build object.
handmade is a waterfall under the hood - a build runs all tasks in series, passing the same build object to each one.
See the example code below (thoroughly commented):
- Empty Task - A task that does nothing.
- Curried Task - A task that accepts options via currying.
First Build
Give this example a look. If you want to work with the filesystem, it's this simple:
// import handmadeconst handmade = // import fs read/write tasksconst read write } = // define a custom task that has access to file dataconst customTask = { // destructure file data from contents let files = contentscore // do work here, sync or async, using the file data // files is an object of file paths -> file contents console // when done, resolve and pass along the contents object } // kick off a new build, passing a path to the root of your project // point it to your source files // add your custom task // point it to where the output should go // kick off the build // do more with the result of the build, if you want to // when shit blows up
See Also
- handmade-fs - File system tasks for handmade.
License
MIT. © 2017 Michael Cavalea