npm package: @rgrannell/pulp
Description: A rational, tiny build system
Latest version: 9.4.0


# pulp (v9.3.0)

## Stability

> 0 - Experimental

A rational, tiny build system


## Overview

Pulp is a build system designed to perform a handful of tasks:

- Bind tasks to the command-line
- Supply command-line arguments to the tasks
- Run a tasks dependencies
- Allow a task to communicate progress to the reporter

It was designed to be a less bulky alternative to `gulp` and similar tools


## Table of Contents

- [add](#add)
  * [Parameters](#parameters)
- [addAll](#addall)
  * [Parameters](#parameters-1)
- [run](#run)
  * [Parameters](#parameters-2)
- [tasks](#tasks)

## API Documentation

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## add

Add a named task to pulp. If this name is provided to pulp by the CLI then this task
  will be executed with additional command-line arguments & an event-emitter for reporting
  status. An array of dependencies will be run before this task.

### Parameters

-   `name` **[string][1]** the name of a task
-   `dependencies` **[Array][2]&lt;[string][1]>** an array of dependency task-names. These dependencies will be
      serially executed (as of this version) before finally executing the task itself.
-   `cli` **[string][1]** an optional CLI specififying arguments consumed by this task.
-   `task` **[function][3]** a binary function, taking args provided by the CLI and an emitter that
      can emit `pulp.events.subTaskProgress` to provide progress updates from the task

## addAll

Add a dictionary of tasks to pulp. This method delegates to .add(), and is a convenience method
  to allow an entire CLI be defined in one command.

### Parameters

-   `state`  
-   `tasks` **[Object][4]** an object of command-name : task pairs

## run

Run the pulp task specified in the command-line arguments. When this command
  is executed pulp will look read the CLI arguments for to find the command specified, and
  will pass the remaining command-line arguments to the named-task selected.

### Parameters

-   `state`  

Returns **[Promise][5]** a result promise

## tasks

Create a new task-list

Returns **[Object][4]** an object with three  methods; `add`, `addAll`, and `run`

[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array

[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function

[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object

[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise


## Dependencies

- Node.js >= v10.6.0
- NPM >= v10.6.0

## License

Copyright (c) 2020 Róisín Grannell

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.