# jscollect

> JS and CSS on-the-fly file merger

Latest version **0.1.3** (published 2013-11-11) · 0 weekly downloads

## Install

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

Provides the command `jscollectd`.

## 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.1.3 |
| Published | 2013-11-11 |
| First published | 2012-05-31 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.4.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Maintainers | omgtehlion, xmm |

## Links

- npm: https://www.npmjs.com/package/jscollect
- Repository: https://github.com/omgtehlion/jscollect
- npm.io page: https://npm.io/package/jscollect

## Dependencies (1)

- [esprima](https://npm.io/package/esprima.md) 0.9.9

## Recent versions

- 0.1.3 (latest) — 2013-11-11
- 0.1.2 — 2013-08-12
- 0.1.1 — 2013-02-07
- 0.1.0 — 2012-12-28
- 0.0.6 — 2012-08-03
- 0.0.4 — 2012-07-16
- 0.0.3 — 2012-06-09
- 0.0.2 — 2012-06-04
- 0.0.1 — 2012-05-31

## README

jscollect
=========
JS and CSS utils set

### What is included

#### jscollectd.js
On-the-fly file merger.

This tool finds all calls of `include('path/to/a/file.js');` in your JavaScripts and embeds
thier content in place of invocation.

In CSS it will find all `@import('path/to/another.css')` statements and do the same thing.
All paths to images and other resources will be rewritten accordingly.

#### freeze.js
Tool for “freezing” images in css files.

### How to use

Use `npm install jscollect` to get the latest version.

```
Usage: jscollectd.js [OPTION]... [FILE]...
Combines files referenced in FILEs into one big script or style.
Can be used on separate files or in server mode.

Options:
  -p, --port PORT  specify http port to listen to when running in server mode
  --docroot ROOT   override default document root:
                     for separate files default is current directory
                     for server mode default is value of X-DocumentRoot header
  --ycssjs         compatibility mode with YCssJs
  -h, --help       display this help and exit

To use in server mode add this to your nginx conf-file:
location ~* \.(js|css)(\?.*)?$ {           # or other location of your js and css assets
    proxy_pass http://localhost:PORT       # change PORT to what you’ve specified in --port
    proxy_set_header X-DocumentRoot $root; # $root should be set to your document root
    gzip off                               # we don’t need gzip in development anyways
}

Exit status is 0 if OK, 1 if there were problems.
```

```
Usage: freeze.js [OPTION]... [FILE]...
Freezes images referenced in css FILE and updates references.

Options:
  -r, --remote URL    specify remote server location where to check image location
  -l, --local PREFIX  specify local directory to freeze images into
  -d, --docroot ROOT  override default document root:
                        default is current directory
  --ycssjs            compatibility mode with YCssJs
  -h, --help          display this help and exit
,
Exit status is 0 if OK, 1 if there were problems.
```

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