# express-staticencode

> A Express static files minificator and encoder

Latest version **1.0.9** (published 2017-09-04) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install express-staticencode
pnpm add express-staticencode
yarn add express-staticencode
bun add express-staticencode
```

## 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.9 |
| Published | 2017-09-04 |
| First published | 2017-08-30 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Heron Beluci |
| Maintainers | heronbeluci |

## Links

- npm: https://www.npmjs.com/package/express-staticencode
- Repository: https://github.com/Heronbeluci/express-staticencode
- Issues: https://github.com/Heronbeluci/express-staticencode/issues
- npm.io page: https://npm.io/package/express-staticencode

## Dependencies (3)

- [express](https://npm.io/package/express.md) ^4.15.4
- [clean-css](https://npm.io/package/clean-css.md) ^4.1.7
- [uglify-js](https://npm.io/package/uglify-js.md) ^3.0.28

## Recent versions

- 1.0.9 (latest) — 2017-09-04
- 1.0.8 — 2017-09-04
- 1.0.7 — 2017-09-04
- 1.0.6 — 2017-09-04
- 1.0.5 — 2017-09-04
- 1.0.4 — 2017-08-30
- 1.0.3 — 2017-08-30
- 1.0.2 — 2017-08-30
- 1.0.1 — 2017-08-30
- 1.0.0 — 2017-08-30
- 2.2.1 — 2017-08-30

## README

[![NPM](https://nodei.co/npm/express-staticencode.png)](https://nodei.co/npm/express-staticencode/)


# Express Static Encode
Basically this module will minify all javascript and CSS files with UglifyJS and CleanCSS automatically, if preload config be active all minifications will occur after the module are called, and all minified files will keep stored in the RAM memory, like a cache, when the preload config is in false the file will cache data after first file get.

#### Basic Usage
```javascript
app.get('/assets/*', staticEncode({
  folder: '/assets',   // Static folder
  jsEncode: true,      // If you dont want to encode JS set to false (Default is true)
  cssEncode: true,     // If you dont want to encode CSS set to false (Default is true)
  preload: true,       // Load after config ended (Default is true)
  uglifyOptions: {},   // UglyfyJS options
  cleanCssOptions: {}, // CleanCSS options
  dev:false            // Set to true to dont save cache and dont encode
}));
```

We recommend <a target="_blank" href="https://www.npmjs.com/package/pkg">PKG</a> to encode the serverside source.

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