open-index/open-npm huggingface dataset:
npm package: @jamen/build
Description: Tool for building web projects (inspired by GNU Make).
Author: Jamen Marz
Latest version: 0.2.0


# Build

> Tool for building web projects (inspired by GNU Make).

Using `build` is a lot like `make`, but there are some key differences:

 - It uses 2 spaces for indents instead of tabs.
 - The `node_modules/.bin` is automatically in the path.
 - Parallel deps are part of the syntax, not the CLI.
 - Command input can be continued on subsequent lines using a 4 space indent.
 - A lot more simplistic than GNU Make, does not include fancy features.

## Install

```
npm i -D @jamen/build
```

With [`npx`](https://github.com/zkat/npx) you can build projects without installing:

```
npx @jamen/build
```

## Usage

To start, create a `buildfile` at the base of your project (next to `package.json`).  This is where you write the tasks.  Using `build [name]` starts the task by name, or the first task if no name is given.

Tasks are written like this:

```makefile
foo:
  command --foo
  command --bar=123

bar: foo
  command
    --flag='Hello world'
    --flag2='Bar baz qux'
```

Or more formally:

```makefile
name: ...deps
  command ...input
    ...input
    ...
```

Another thing to know is that deps can be run in parallel by prefixing `@`.

```makefile
foo: bar @baz
  echo 'Hello world'
```

Also note you can run groups of parallel tasks by switching in and out of the above:

 - `foo @bar baz qux`
 - `foo @bar @baz qux`
 - `foo @bar @baz @qux`

A dep without `@` makes it wait for all the tasks before it to start.
npm package: @jamen/dev-server
Description: Watch files, execute build scripts, and launch an auto-reloading dev server.
Author: Jamen Marz
Latest version: 2.0.0


# @jamen/dev-server

![example](example.gif)

Watch files, execute build scripts, and launch an auto-reloading dev server.

## Install

```sh
npm i @jamen/dev-server
```

Or use `npx`

```sh
npx @jamen/dev-server
```

## Usage

### `dev-server <entry> --watch <glob> <command>`

Starts a server at `entry` and creates the given watchers.

```sh
$ dev-server dist --watch "src/**/*.js" "make js"
$ dev-server dist --watch "src/**/*.js" "cat $FILE"
```

Use `$FILE` inside the command string to access the path.

Allows multiple watchers:

```sh
$ dev-server dist --watch "src/**/*.js" "make js" \
                  --watch "src/**/*.css" "make css" \
                  --watch "src/**/*.html" "make html"
```

The flags available are:

- `--watch`, `-w` Source files to watch and the command to execute.
- `--port`, `-p` Changes port of the server (defaults to `3000`).
- `--host`, `-h` Changes host of the server (defaults to `localhost`).
- `--open`, `-o` Automatically opens page in browser (defaults to `false`).
- `--gzip`, `-g` Compress each file and serve as `*.gz`. (defaults to `false`).
- `--ssl`, `-S` Enables HTTPS with a key and cert (defaults to `false`).
- `--cert`, `-C` Certificate file for HTTPS (defaults to `cert.pem`).
- `--key`, `-K` Key file for HTTPS (defaults to `key.pem`).
- `--cors` Enable CORS on the server (defaults to `false`).
- `--ignore`, `-i` Array of globs to exclude from `--watch` (defaults to `node_modules` and `.git`).

Without a directory to serve from, defaults to `./dist`
npm package: @jamen/dist-css
Description: Create dist version of your CSS.
Author: Jamen Marz
Latest version: 0.2.0


# @jamen/dist-css

> Create dist version of your CSS.

Combines tools for adding comptibility and optimizations to your CSS compiler's
output.

```sh
$ dist-css dist/app.css
```

This will

- Run `postcss` with `autoprefixer`.
- Run `clean-css`.
- Use sourcemaps when given input and output paths.

Also see [`@jamen/dist-js`](https://github.com/jamen/dist-js) for your JS files.

## Install

```sh
$ npm i -D dist-css
```

## Usage

### `dist-css [file] [...options]`

The easiest way to use the tool is transforming a file in place:

```sh
$ dist-css dist/app.css
```

It will also detect when you want to use stdio:

```sh
# Using stdout
$ dist-css dist/app.css | wc -c
6780

# Using stdin
$ echo "* { box-sizing: border-box }" | dist-css dist/app.css
finished dist-css at dist/app.css

# Using both
$ echo "a { ... }" | dist-css > dist/app.css
```

Alternative to this, use the `--input`, `-i` and `--output`, `-o` flags, where
if a flag is absent it uses the stdio equivalent instead.

Also note that you can only accept a sourcemap with an input path, and write a
sourcemap with an output path.  Inline sourcemaps are not supported out of
simplicity.

To disable sourcemaps regardless, supply the `--no-sourcemap` flag:

```sh
$ dist-css --no-sourcemap dist/app.css
```
npm package: @jamen/dist-js
Description: Create dist version of your JS.
Author: Jamen Marz
Latest version: 0.3.0


# @jamen/dist-js

> Create dist version of your JS.

Combines tools for adding comptibility and optimizations to your JS compiler's
output.

```sh
$ dist-js dist/app.js
```

This will

- Run `babel` with `babel-preset-env`.
- Run `uglify-es`.
- Use sourcemaps when given input and output paths.

Also see [`@jamen/dist-css`](https://github.com/jamen/dist-css) for your CSS files.

## Install

```sh
$ npm i -D dist-js
```

### `dist-js [file] [...options]`

The easiest way to use the tool is transforming a file in place:

```sh
$ dist-js dist/app.js
```

It will also detect when you want to use stdio:

```sh
# Using stdout
$ dist-js dist/app.js | wc -c
6780

# Using stdin
$ echo "console.log(1 + 2)" | dist-js dist/app.js
finished dist-js at dist/app.js

# Using both
$ echo "1 + 2" | dist-js > dist/app.js
```

Alternative to this, use the `--input`, `-i` and `--output`, `-o` flags, where
if a flag is absent it uses the stdio equivalent instead.

Also note that you can only accept a sourcemap with an input path, and write a
sourcemap with an output path.  Inline sourcemaps are not supported out of
simplicity.

To disable sourcemaps regardless, supply the `--no-sourcemap` flag:

```sh
$ dist-js --no-sourcemap dist/app.js
```