Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pamorana/express-jquery

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pamorana/express-jquery

A middleware to serve jQuery, for Express

  • 1.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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.

Keywords

FAQs

Package last updated on 05 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc