# ekam

> Package builder with includes

Latest version **0.0.10** (published 2013-03-13) · 0 weekly downloads

## Install

```sh
npm install ekam
pnpm add ekam
yarn add ekam
bun add ekam
```

Provides the command `ekam`.

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.10 |
| Published | 2013-03-13 |
| First published | 2012-02-19 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.6 |
| Dependencies | 10 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Pierre Curto |
| Maintainers | pierrec |
| Keywords | build, builder, include, make |

## Links

- npm: https://www.npmjs.com/package/ekam
- Repository: https://github.com/pierrec/node-ekam
- Homepage: http://github.com/pierrec/node-ekam
- Issues: http://github.com/pierrec/node-ekam/issues
- npm.io page: https://npm.io/package/ekam

## Dependencies (10)

- [eval](https://npm.io/package/eval.md) >= 0.1.0
- [async](https://npm.io/package/async.md) >= 0.1.16
- [debug](https://npm.io/package/debug.md) >= 0.5
- [fileset](https://npm.io/package/fileset.md) >= 0.1.2
- [fstream](https://npm.io/package/fstream.md) >= 0.1
- [shelljs](https://npm.io/package/shelljs.md) *
- [inherits](https://npm.io/package/inherits.md) >= 1.0
- [commander](https://npm.io/package/commander.md) >= 0.5
- [uglify-js](https://npm.io/package/uglify-js.md) 1.x
- [atok-parser](https://npm.io/package/atok-parser.md) >= 0.3.1

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 0.0.10 (latest) — 2013-03-13
- 0.0.9 — 2012-07-16
- 0.0.8 — 2012-06-25
- 0.0.7 — 2012-05-06
- 0.0.6 — 2012-04-23
- 0.0.5 — 2012-03-15
- 0.0.4 — 2012-03-11
- 0.0.3 — 2012-03-08
- 0.0.2 — 2012-02-23
- 0.0.1 — 2012-02-20
- 0.0.0 — 2012-02-19

## README

# Package builder

## Synopsis

Ekam is yet another build tool for node, designed to handle file includes, regardless of the file format, although it is primarily aimed at building javascript, html and css files. It comes as a single command line utility.

As of the current version, only JavaScript is supported, although html and css are planned and easy to add, as well as other formats.


## Download

It is published on node package manager (npm). To install, do:

    npm install ekam -g


## Usage

    ekam --help

    Usage: ekam [options]

      Options:

        -h, --help                     output usage information
        -V, --version                  output the version number
        -b, --build <js or json file>  Use the specified build file
        -i, --init                     Creates default sample build files (build.json build.js)
    	-f, --force                    Overwrite existing build files



Ekam takes either a json file or a JavaScript file containing information about what it has to do.

	ekam --build src/build.json
or

	ekam --build src/build.js


Sample build.json and build.js files can be produced with the option `init` (overwrite existing files with the `force` option)

	ekam --init

* build.json

``` javascript
{
	"input": {
		"include": "**/*.js"
	, "exclude": "build.json build.js"
	}
,	"output": {
		"path": "../build"
	, "mode": "0755"
	, "clean": true
	}
,	"uglify": {
		"mangle": {
			"defines": {
				"DEBUG": [ "name", "false" ]
			}
		}
	,	"squeeze": {
			"make_seqs": true
		,	"dead_code": true
		}
	,	"gen": {
		}
	}
}
```

* build.js

``` javascript
build(
	{
		"input": {
			"include": "**/*.js"
		, "exclude": "build.json build.js"
		}
	,	"output": {
			"path": "../build"
		, "mode": "0755"
		, "clean": true
		}
	,	"uglify": {
			"mangle": {
				"defines": {
					"DEBUG": [ "name", "false" ]
				}
			}
		,	"squeeze": {
				"make_seqs": true
			,	"dead_code": true
			}
		,	"gen": {
			}
		}
	}
)
```


The following properties are required:

* `input`
	* `include` (_String_): list of expressions or files to be processed
	* `exclude` (_String_): list of expressions or files to be excluded
* `output`: the properties are the same as the ones defined in the [fstream](https://github.com/isaacs/fstream) module
	* `path` (_String_): path to the generated files

The following properties are optional:

* `uglify`: contains the options object passed to the `uglify()` method

To run the tool with DEBUG information, set the DEBUG environment variable to a list of comma separated values:

	DEBUG=ekam,build,include,file,js-parser,js-ast ekam --build src/build.json

* ekam
* build
* include
* file
* js-ast


## Example

Let's say we have to build a single javascript file split up in two files as well as its minified and debug versions. The example is provided in the examples/example1 directory.

__Important__ only files with no parent dependency get built in the output directory.

The input files are defined under the src/ directory:

* src/file1.js
* src/file2.js

The output files are to be defined as (yes they are defined in the input directory!):

* src/file.js

``` javascript
//include("file1.js", "file2.js")
```

* src/file.debug.js

``` javascript
//var DEBUG=true
//include("file1.js", "file2.js")
```

The files file1.js and file2.js should contain a line like the following one to include some debug traces:

``` javascript
//if(DEBUG)
console.log('DEBUG', ...)
//endif
```

* src/file.min.js

``` javascript
//uglify("_file.js")
```

* src/_file.js

This is a temporary file that collects the content for the minified version.

``` javascript
//include("file1.js", "file2.js")
```

When the `ekam` command is run, it creates the following files (note that the www/ directory is automatically created if it does not exist already):

* www/file.js - concatenation of file1.js and file2.js
* www/file.debug.js - same as file.js but with debug commands
* www/file.min.js - minified version of file.js

---
_Source: https://npm.io/package/ekam · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
