js-jquery: Obtain minified jQuery code
This package bundles the minified jQuery code into a Haskell package, so it can be depended upon by Cabal packages. The first three components of the version number match the upstream jQuery version. The package is designed to meet the redistribution requirements of downstream users (e.g. Debian).
[Skip to Readme]
Downloads
- js-jquery-3.7.1.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
| Versions [RSS] | 1.11.1, 1.11.2, 1.11.3, 1.12.0, 1.12.1, 1.12.2, 1.12.3, 1.12.4, 3.0.0, 3.1.0, 3.1.1, 3.2.1, 3.3.1, 3.7.1 |
|---|---|
| Change log | CHANGES.txt |
| Dependencies | base (>=4 && <5) [details] |
| Tested with | ghc ==9.12, ghc ==9.10, ghc ==9.8, ghc ==9.6, ghc ==9.4, ghc ==9.2, ghc ==9.0 |
| License | MIT |
| Copyright | Neil Mitchell 2014-2025 |
| Author | Neil Mitchell <ndmitchell@gmail.com> |
| Maintainer | Neil Mitchell <ndmitchell@gmail.com> |
| Category | Javascript |
| Home page | https://github.com/ndmitchell/js-jquery#readme |
| Bug tracker | https://github.com/ndmitchell/js-jquery/issues |
| Source repo | head: git clone https://github.com/ndmitchell/js-jquery.git |
| Uploaded | by NeilMitchell at 2025年02月09日T22:52:37Z |
| Distributions | Arch:3.7.1, Debian:3.3.1, Fedora:3.3.1, FreeBSD:1.11.3, LTSHaskell:3.7.1, NixOS:3.7.1, Stackage:3.7.1 |
| Reverse Dependencies | 9 direct, 3762 indirect [details] |
| Downloads | 51268 total (28 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating |
|
| Status | Docs available [build log] Last success reported on 2025年02月09日 [all 1 reports] |
Readme for js-jquery-3.7.1
[back to package description]js-jquery Hackage version Stackage version Build status
This package bundles the minified jQuery code into a Haskell package, so it can be depended upon by Cabal packages. The first three components of the version number match the upstream jQuery version. The package is designed to meet the redistribution requirements of downstream users (e.g. Debian). As an example:
import qualified Language.Javascript.JQuery as JQuery
main = do
putStrLn $ "jQuery version " ++ show JQuery.version ++ " source:"
putStrLn =<< readFile =<< JQuery.file
This package installs data files containing the jQuery sources, which must be available at runtime. If you want to produce an executable with no dependency on associated data files, you can use the file-embed library:
{-# LANGUAGE TemplateHaskell #-}
import Data.FileEmbed
import qualified Data.ByteString as BS
import qualified Language.Javascript.JQuery as JQuery
import Language.Haskell.TH.Syntax
main = print jQueryContents
jQueryContents :: BS.ByteString
jQueryContents = $(embedFile =<< runIO JQuery.file)
Or, within the Yesod framework, yesod-static:
{-# LANGUAGE TemplateHaskell, QuasiQuotes, TypeFamilies #-}
import Yesod
import Yesod.EmbeddedStatic
import qualified Language.Javascript.JQuery as JQuery
data MySite = MySite {
...
, getStatic :: EmbeddedStatic
...
}
-- Create a Route `jquery_js` to a statically-serveable version of the local jQuery lib.
mkEmbeddedStatic False "myStatic" . pure . embedFileAt "jquery.js" =<< runIO JQuery.file
mkYesod "PresentationServer" [parseRoutes|
/ HomeR Get
...
/static StaticR EmbeddedStatic getStatic
|]
instance Yesod PresentationServer where
addStaticContent = embedStaticContent getStatic StaticR Right
getHomeR :: Handler Html
getHomeR = defaultLayout $ do
addScript $ StaticR jquery_js
...
(See also sample-embed.hs.)