1.0.1 • Published 10 years ago

scourge v1.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
10 years ago

scourge

Replace resource locators in JavaScript and CSS files, great for static asset hashing

Use as a CLI or programmatically.

Install

npm install --save-dev scourge

API

The API exposes a function.

scourge(sources, options, done)

Scans the provided directories and any sub-directories for JavaScript, CSS, and Jade files; fixing references according to the provided manifest.

OptionDescription
baseUrlThe base url to detect, defaults to /
basePathRelative base path that matches baseUrl, defaults to ./public/
mapObject mapping paths to replace with replacement paths
globAssume the provided paths are directories to be globbed, defaults to true. When set to false, treats them as raw file paths instead
domainDomain reference that may appear in instances of the URL, e.g: http://ponyfoo.com

done is invoked when the operation is complete.

CLI

Usage

scourge [dir] [dir] [dir]

Invokes the scourge(sources, options) API method, using minimist for option parsing.

Example

The CLI works great with reaver, being able to consume its output directly.

reaver public/img/* | scourge views

Alternatively provide a --map option, pointing to a JSON file.

License

MIT

1.0.1

10 years ago

1.0.0

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago

0.0.1

10 years ago