jam

所属分类:collect
开发工具:JavaScript
文件大小:0KB
下载次数:0
上传日期:2016-10-06 07:30:52
上 传 者sh-1993
说明:  JavaScript包管理器-使用以浏览器为中心且与RequireJS兼容的存储库,
(JavaScript package manager - using a browser-focused and RequireJS compatible repository,)

文件列表:
LICENSE (1058, 2016-09-05)
bin/ (0, 2016-09-05)
bin/jam.js (1575, 2016-09-05)
index.js (6728, 2016-09-05)
lib/ (0, 2016-09-05)
lib/args.js (2068, 2016-09-05)
lib/cache.js (2850, 2016-09-05)
lib/commands/ (0, 2016-09-05)
lib/commands/clean.js (5633, 2016-09-05)
lib/commands/clear-cache.js (981, 2016-09-05)
lib/commands/compile.js (8881, 2016-09-05)
lib/commands/help.js (994, 2016-09-05)
lib/commands/index.js (489, 2016-09-05)
lib/commands/install.js (21297, 2016-09-05)
lib/commands/link.js (4069, 2016-09-05)
lib/commands/ls.js (3161, 2016-09-05)
lib/commands/pack.js (1159, 2016-09-05)
lib/commands/publish.js (2091, 2016-09-05)
lib/commands/rebuild.js (2973, 2016-09-05)
lib/commands/remove.js (4141, 2016-09-05)
lib/commands/search.js (3650, 2016-09-05)
lib/commands/unpublish.js (1757, 2016-09-05)
lib/commands/upgrade.js (8685, 2016-09-05)
lib/couchdb.js (13193, 2016-09-05)
lib/env.js (1309, 2016-09-05)
lib/fstream-jam.js (9860, 2016-09-05)
lib/github.js (2217, 2016-09-05)
lib/jamrc.js (4758, 2016-09-05)
lib/logger.js (3157, 2016-09-05)
lib/packages.js (7401, 2016-09-05)
lib/project.js (9203, 2016-09-05)
lib/repository.js (18484, 2016-09-05)
lib/settings.js (1793, 2016-09-05)
lib/tar.js (4780, 2016-09-05)
lib/tree.js (7656, 2016-09-05)
lib/utils.js (10488, 2016-09-05)
lib/versions.js (1969, 2016-09-05)
package.json (969, 2016-09-05)
... ...

****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](http://requirejs.org/docs/whyamd.html). 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](#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](http://jamjs.org) ## Example usage $ jam install jquery ```html ``` [Learn more...](http://jamjs.org) ## 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: ```javascript { "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](http://nodejs.org) ## 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. ```javascript 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: ```javascript 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: ```javascript 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. ```javascript 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](http://www.iriscouch.com/) 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 ``` 2. 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 ``` 3. 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](https://github.com/rnewson/couchdb-lucene#build-and-run-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](http://jamjs.org/docs). ## Links * [Homepage](http://jamjs.org) * [Packages](http://jamjs.org/packages/) * [Docs](http://jamjs.org/doc)

近期下载者

相关文件


收藏者