# js-combiner

> An assets combine and minify tool

Latest version **1.0.1** (published 2013-05-15) · 0 weekly downloads

## Install

```sh
npm install js-combiner
pnpm add js-combiner
yarn add js-combiner
bun add js-combiner
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2013-05-15 |
| First published | 2013-02-10 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Daniel Husár |
| Maintainers | efrafa |
| Keywords | assets, asset, combine, minify, packer, compressor, compress, client, variables |

## Links

- npm: https://www.npmjs.com/package/js-combiner
- Repository: https://github.com/danielhusar/js-combiner
- npm.io page: https://npm.io/package/js-combiner

## Dependencies (2)

- [uglify-js](https://npm.io/package/uglify-js.md) 2.2.3
- [underscore](https://npm.io/package/underscore.md) >=1.1.7

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2013-05-15
- 1.0.0 — 2013-02-10

## README

# js-combiner

An assets combine and minify tool



## Description

Js-combiner is a simple tool to combine and minify javascript files. It can also share server side variables to client side js files.

## Installation
Download and place it inside node_moudles.
Or use npm: npm install js-combiner.
Tested only under express.

# Usage

file: app.js
```javascript
var combiner = require('js-combiner')(
			{
				'files' : ['/bundle.js']
			});
```

file: /public/bundle.js
```javascript
require('/app.js');   
require('/events.js')
require("/global.js");
```

New generated file with all the content will be: /public/packed/bundle.packed.js

Combiner settings:
```javascript
{
	'files'        : [],             //array of files where search for require directives
	'minify'       : false,          //minify the whole files
	'reload'       : false,          //recreate file when theres some change in required files
	'log'          : false,          //output logs
	'packedSuffix' : 'packed',       //suffix of the new recreated file
	'packedFolder' : 'packed',       //folder where to put packed files
	'folder'       : '/public/js',   //folder where are the js files located
	'cwd'          : process.cwd(),  //current working directory
	'vars'         : {}              //extra variables to put into client js file
}
```

You can also pass custom variables inside vars property, like:
```javascript
var combiner = require('js-combiner')(
			{
				'files' : ['/bundle.js'],
				'vars'	: {
					'ENV' : 'production'
				}
			});
```
And than acces this variable inside client js files by calling: ${ENV}

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