• This repository has been archived on 07/Aug/2019
  • Stars
    star
    1,497
  • Rank 31,357 (Top 0.7 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 12 years ago
  • Updated about 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

JavaScript package manager - using a browser-focused and RequireJS compatible repository

****NOTE: this project is no longer active and not recommended for use. It is left here for reference. ****

Jam was created at a time before Bower and provided a (still to this day) very nice installation workflow which meant you could 'jam install jquery', then immediately 'require("jquery")' in your application. No manual bundling or build step (e.g. browserify, webpack) required. This was thanks in large part to the power and flexibility of the AMD format.

Since it's creation, NPM has set it's sights more firmly on the browser space, and the popularity of the AMD module format is waning. Jam never really got enough traction to compete. Thanks to everone that helped out and gave it a try.

If you want to try hosting your own Jam repository, see the repositories section below. The public Jam repository is now retired.


Jam

For front-end developers who crave maintainable assets, Jam is a package manager for JavaScript. Unlike other repositories, we put the browser first.

  • Manage dependencies - Using a stack of script tags isn't the most maintainable way of managing dependencies, with Jam packages and loaders like RequireJS you get automatic dependency resolution.

  • Fast and modular - Achieve faster load times with asynchronous loading and the ability to optimize downloads. JavaScript modules and packages provide properly namespaced and more modular code.

  • Use with existing stack - Jam manages only your front-end assets, the rest of your app can be written in your favourite language or framework. Node.js tools can use the repository directly with the Jam API.

  • Custom builds - No more configuring custom builds of popular libraries. Now, every build can be optimized automatically depending on the parts you use, and additional components can always be loaded later.

  • Focus on size - Installing multiple versions works great on the server, but client-side we don't want five versions of jQuery! Jam can use powerful dependency resolution to find a working set of packages using only a single version of each.

  • 100% browser - Every package you see here will work in the browser and play nicely with module loaders like RequireJS. We're not hijacking an existing repository, we're creating a 100% browser-focused community!

Visit the Jam website

Example usage

$ jam install jquery
<script src="jam/require.js"></script>

<script>
    require(['jquery'], function ($) {
        ...
    });
</script>

Learn more...

Browser packages in package.json

You can also define your browser dependencies in a project-level package.json file. If you use Node.js, this format will already familiar to you, and the Jam dependencies can live alongside your NPM dependencies. It's also possible to define custom install paths and baseUrls, as well as hand in any requirejs configuration here:

{
    "name": "my-project",
    "version": "0.0.1",
    "description": "My example project",
    "jam": {
        "baseUrl": "public",
        "packageDir": "public/vendor",
        "dependencies": {
            "jquery": "1.7.x",
            "underscore": null
        },
        "config": {
          "paths": {
            "templates": "public/templates"
          }
        }
    }
}

Installation

# npm install -g jamjs

Requires node.js

Settings

You can customize Jam by creating a .jamrc file in your home directory.

.jamrc

repositories

An array with Jam repositiories. Jam uses http://jamjs.org/repository by default, but it's possible to create a local, e.g. corporate, repository.

exports.repositories = [
    "http://mycorporation.com:5984/repository/",
    "http://jamjs.org/repository"
];

Repositories are in preference-order, so packages from repositories earlier in the list will be preferred over packages in repositories later in the list. However, when no package version is specified, the highest version number will be installed (even if that's not from the earliest repository).

You can add custom search URLs to repositories too:

exports.repositories = [
    {
        url: "http://mycorporation.com:5984/repository/",
        search: "http://db.com:5984/_fti/key/_design/search/something"
    },
    "http://jamjs.org/repository"
];

If your local repository doesn't implement full text search (e.g. you don't want to install couchdb lucene), you can disable searching functionality for that repository, otherwise jam search would report an error:

exports.repositories = [
    {
        url: "http://mycorporation.com:5984/repository/",
        search: false
    },
    "http://jamjs.org/repository"
];

See the section below on running your own repository.

package_dir

Sets the default package installation directory (normally uses ./jam). This is best customized in your project-level package.json file, to ensure other developers also install to the correct location.

exports.package_dir = 'libs';

Running the tests

Jam includes two test suites, unit tests (in test/unit) and integration tests (in test/integration). The unit tests are easy to run by running the test/unit.sh script, or test\unit.bat on Windows. The integration tests first require you to set up a CouchDB instance to test against (you can get a free account at IrisCouch if you don't want to install CouchDB). You then need to set the JAM_TEST_DB environment variable to point to a CouchDB database URL for testing:

Linux

export JAM_TEST_DB=http://user:password@localhost:5984/jamtest

Windows

set JAM_TEST_DB=http://user:password@localhost:5984/jamtest

Warning: All data in the test database will be deleted!

You can then run the integration tests using test/integration.sh or test\integration.bat. To run BOTH the unit and integration tests use test/all.sh or test\all.bat.

Running your own private repository or mirror

  1. Install couchdb

Mac OS X:

1. Install [Homebrew](http://mxcl.github.com/homebrew/).
2. 
brew install couchdb

Ubuntu:

apt-get install couchdb
  1. Configure your database
curl -X POST http://127.0.0.1:5984/_replicate -d '{
    "source":"http://jamjs.org/repository",
    "target":"http://localhost:5984/repository",
    "continuous":true,
    "doc_ids":["_design/jam-packages"]
    }' -H "Content-Type: application/json"

To create a mirror:

curl -X POST http://127.0.0.1:5984/_replicate -d '{
    "source":"http://jamjs.org/repository",
    "target":"repository",
    "continuous":true,
    "create_target":true
    }' -H "Content-Type: application/json"

To create an empty, private repository:

curl -X PUT http://127.0.0.1:5984/repository
  1. Edit your .jamrc file to use your new repository:
exports.repositories = [
    {
        url: "http://localhost:5984/repository",
        search: false
    },
    "http://jamjs.org/repository"
];

Adding search

  1. Install couchdb-lucene
  2. Restart couchdb.
  3. Edit your .jamrc file to allow searching on your repository:
exports.repositories = [
    {
        url: "http://localhost:5984/repository",
        search: "http://localhost:5984/_fti/local/repository/_design/jam-packages/packages/"
    },
    "http://jamjs.org/repository"
];

Publishing packages to your private repository

jam publish --repository http://localhost:5984/repository

More documentation

To learn how to create and publish packages etc, and for more info on using packages, consult the Jam documentation website.

Links

More Repositories

1

async

Async utilities for node and the browser
JavaScript
28,095
star
2

highland

High-level streams library for Node.js and the browser
JavaScript
3,427
star
3

nodeunit

Easy unit testing in node.js and the browser, based on the assert module.
JavaScript
1,899
star
4

forms

An easy way to create, parse and validate forms in node.js
JavaScript
1,010
star
5

pithy

An internal DSL for generating HTML in JavaScript
JavaScript
435
star
6

nimble

A really tiny functional JavaScript and async flow-control library
JavaScript
329
star
7

petrify

A flexible static site generator for node.js
JavaScript
259
star
8

cookie-sessions

Secure cookie-based session middleware for Connect
JavaScript
97
star
9

quip

A chainable API for response objects in node
JavaScript
92
star
10

dispatch

A regular expression URL dispatcher for Connect
JavaScript
84
star
11

magery

JavaScript templates for progressive enhancement
JavaScript
56
star
12

copykitten

Tiny immutable JSON data structures
JavaScript
40
star
13

jquery.notify.js

Ubuntu-style notifications within a web browser
JavaScript
25
star
14

couchr

Lightweight CouchDB request library for Node and the browser
JavaScript
22
star
15

hoodie-drawing

Hoodie drawing demo app
JavaScript
20
star
16

cpm

CouchDB Package Manager - a tool for the management of CouchApps and associated libraries
JavaScript
16
star
17

wmd

wanton markdown - a markdown parser based on showdown
JavaScript
15
star
18

blog

CouchApp code used to run my blog
JavaScript
15
star
19

tamawiki

I'm learning Rust!
Rust
13
star
20

chicken-toml

A TOML parser for CHICKEN Scheme built with comparse
Scheme
11
star
21

docker-hoodie

Basic docker file for trying out hoodie
Shell
10
star
22

bootstrap-less

Kanso package providing uncompiled less files for bootstrap with images and js as attachments
JavaScript
10
star
23

behaviors

A (really) simple way to check a modules export's in node.js. Inspired by behaviors in Erlang.
JavaScript
9
star
24

snowy

HTTP server for CHICKEN Scheme
C
8
star
25

events

Browser port of the node.js events module
JavaScript
8
star
26

lolcorp

Intentionally insecure example Node.js applications
JavaScript
7
star
27

raspberry-pi-gpio

Raspberry Pi GPIO library for CHICKEN Scheme
Scheme
6
star
28

scrawl

Dumb comment parsing
JavaScript
6
star
29

pithy2

A Typescript-friendly and human-friendly API for building DOM elements
TypeScript
5
star
30

snake

Snake game for the BBC micro:bit
Python
5
star
31

erlmpd

An Erlang client module for MPD
Erlang
5
star
32

chicken-leveldb

CHICKEN Scheme bindings to LevelDB
Scheme
5
star
33

python-magery

Python implementation of Magery templates
Python
5
star
34

highland-couchr

Highland streams style API to CouchDB, using couchr under the hood
JavaScript
4
star
35

mutiny

Rust
4
star
36

chicken-sodium

CHICKEN Scheme bindings to libsodium crypto library
Scheme
3
star
37

0

3
star
38

ghstats

allows you to compare github users followers and project watchers
JavaScript
3
star
39

couchr-browser

Lightweight library for making CouchDB requests, based on jQuery
JavaScript
2
star
40

couchi

CouchDB command-line interface
JavaScript
2
star
41

magery-tests

Test suite for server implementations of Magery templates
HTML
2
star
42

chat

Kanso chat app
JavaScript
2
star
43

lmdb-lolevel

Low-level CHICKEN Scheme bindings to LMDB, closely following the C API
Scheme
2
star
44

condor

C O N D O R
JavaScript
2
star
45

chicken-level

abstract API layer for chicken-leveldb
Scheme
2
star
46

gamejam

First Play Sheffield Game Jam!
JavaScript
2
star
47

chicken-ldap-bind

Implements LDAP bind for authentication using OpenLDAP
Scheme
2
star
48

library

CouchApp for storing templates
JavaScript
2
star
49

chicken-gumbo

C binding to the Gumbo HTML parser for CHICKEN Scheme
Scheme
2
star
50

dust

P2P event streams
Scheme
2
star
51

users-core

Core resources for the users app, must be used with a theme (eg, users-default)
JavaScript
2
star
52

gh-label-dashboard

An example of using the github search API to query labels across all repositories in an organisation
1
star
53

validatejs

JavaScript
1
star
54

webhook-test

1
star
55

users-default

Default bootstrap theme for users app
1
star
56

chicken-sublevel

Namespaced access to leveldb implementations
Scheme
1
star
57

chicken-level-sexp

Automatically read and write s-expressions to leveldb
Scheme
1
star
58

chicken-fnmatch

Test filenames against shell wildcard patterns using fnmatch
Scheme
1
star
59

jambot

IRC bot for #jamjs
JavaScript
1
star
60

mochiproxy

Easily proxy mochiweb requests, based on the CouchDB proxy module
Erlang
1
star
61

highland-couchdb-alldocs

Provides Highland streams for reading all keys/docs in a CouchDB database
JavaScript
1
star