# join-script

> joins consecutive script tags into one script

Latest version **2.0.0** (published 2017-02-14) · BSD license · 0 weekly downloads

## Install

```sh
npm install join-script
pnpm add join-script
yarn add join-script
bun add join-script
```

Provides the command `join-script`.

## 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 | 2.0.0 |
| Published | 2017-02-14 |
| First published | 2017-02-01 |
| Weekly downloads | 0 |
| License | BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Mateusz Kwasniewski |
| Maintainers | kwasniew |

## Links

- npm: https://www.npmjs.com/package/join-script
- Repository: https://github.com/kwasniew/join-script
- Issues: https://github.com/kwasniew/join-script/issues
- npm.io page: https://npm.io/package/join-script

## Dependencies (3)

- [mkdirp](https://npm.io/package/mkdirp.md) 0.5.1
- [cheerio](https://npm.io/package/cheerio.md) 0.22.0
- [minimist](https://npm.io/package/minimist.md) 1.2.0

## Recent versions

- 2.0.0 (latest) — 2017-02-14
- 1.1.1 — 2017-02-05
- 1.1.0 — 2017-02-04
- 1.0.0 — 2017-02-01

## README

# join-script

Joins consecutive script tags into one.
Useful for simple scenarios when you don't need AMD.

Turns
```
  <body>
    <script src="js/one.js"></script>
    <script src="js/two.js"></script>
    <script src="js/three.js"></script>
  </body>
```
into
```
  <body>
    <script src="js/main.js?v=c9a7c7ed62"></script>
  </body>
```
Hash is MD5 of the joined content.

## Usage
```
npm install join-script
```
Default settings (no defer/async, finds scripts inside head and body, generates js/main.js?v={hash}) at the end of the body
```
join-script example/index.html > example/index.after.html
```

Make script async, only analyze scripts inside head and create custom output script with explicit name and
injected to the end of the body
```
join-script --async=true --from=head --to=body --output="js/main.js?v={hash}" example/index.html > example/index.after.html
```

Add defer to script
```
join-script --defer=true example/index.html > example/index.after.html
```


Ideas:
- fetch remote scripts (for now we ignore them)

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