1.0.5 • Published 7 years ago

@pamorana/express-jquery v1.0.5

Weekly downloads
4
License
MIT
Repository
gitlab
Last release
7 years ago

express-jquery

license npm npm

const express = require('express');
const expressJQuery = require('@pamorana/express-jquery');
const app = express();

app.use('/js', expressJQuery({
    full: true,
    slim: true,
}));

app.listen(3000);

Installation

Install express-jquery as well as a jQuery version of your choice.

Using yarn

yarn add @pamorana/express-jquery jquery@latest

Using npm

npm install @pamorana/express-jquery jquery@latest --save

Documentation

Set up an Express app

const express = require('express');
const expressJQuery = require('@pamorana/express-jquery');
const app = express();

app.listen(3000);

Options

The default options will serve both the full and slim build of jQuery in their respective minified form.

OptionDescriptionTypeDefault
fullWheter to serve the default version of jQuery, both unminifed and minified versions.Boolean
fullSame as above but gives control of which veresion should be served. First value is unminifed, second is minfied.Boolean[][false, true]
slimWheter to serve the slim version of jQuery, both unminifed and minified versions.Boolean
slimSame as above but gives control of which veresion should be served. First value is unminifed, second is minfied.Boolean[][false, true]

Where are the files served?

Given the topmost example, files will be served directly in the /js route:

FileFull buildSlim build
Unminifiedexample.com/js/jquery.jsexample.com/js/jquery.slim.js
Minifiedexample.com/js/jquery.min.jsexample.com/js/jquery.slim.min.js
Mapexample.com/js/jquery.min.mapexample.com/js/jquery.slim.min.map

Examples

Serve all builds

app.use(expressJQuery({
    full: true,
    slim: true,
}));

Serve only minifed bulids

app.use(expressJQuery({
    full: [ false, true ],
    slim: [ false, true ],
}));

Serve only unminifed builds

app.use(expressJQuery({
    full: [ true, false ],
    slim: [ true, false ],
}));

Serve only full build

app.use(expressJQuery({
    full: true,
}));

Serve only slim build

app.use(expressJQuery({
    slim: true,
}));

Contributing

File an issue or even better create a merge request.

License

MIT © Pamorana and contributors.

1.0.5

7 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago