# onepage-rev

> One page app rev tool

Latest version **0.0.2** (published 2014-12-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install onepage-rev
pnpm add onepage-rev
yarn add onepage-rev
bun add onepage-rev
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2014-12-19 |
| First published | 2014-12-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| Author | jiyinyiyong |
| Maintainers | jiyinyiyong |
| Keywords | rev, Single Page App |

## Links

- npm: https://www.npmjs.com/package/onepage-rev
- npm.io page: https://npm.io/package/onepage-rev

## Dependencies (2)

- [lodash](https://npm.io/package/lodash.md) ^2.4.1
- [fs-extra](https://npm.io/package/fs-extra.md) ^0.13.0

## Recent versions

- 0.0.2 (latest) — 2014-12-19
- 0.0.1 — 2014-12-19

## README

Onepage Rev
----

Clone files with MD5 hash in filenames before puroduction.

```
npm i --save-dev onepage-rev
```

```coffee
rev = require 'onepage-rev'
rev.config
  htmlScaner: ->
  cssScaner: ->
rev.run
  base: 'src/'
  src: 'index.html'
  dest: 'dist/'
# => returns a promise
```

### Demo

```coffee
rev = require 'onepage-rev'

rev.config
  htmlScaner: (text) ->
    collection = []
    match = text.match /([-\w\.\/]+)\.(css|js)(?=")/g
    collection.push match... if match?
    collection

  cssScaner: (text) ->
    collection = []
    r = /([-\w\.\/@]+)\.(css|jpg|png|woff|eot|ttf|svg)(?=('|\)))/g
    match = text.match r
    collection.push match... if match?
    collection

  done: ->

rev.run
  base: __dirname
  src: 'index.html'
  dest: './dist/'
  cdn: 'https://dn-demo.oss.aliyuncs.com'
```

### Details

Format of records:

```coffee
fullpath: ''
replaceText: '' # found by scaner to be replaced
resolvedPath: ''
hashPath: ''
type: '' # extension name
children: [
  # replaceText
]
```

### License

MIT

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