Files
jspm-registry/README.md
T

42 lines
1.4 KiB
Markdown
Raw Normal View History

2013-09-27 10:16:16 +02:00
JSPM Registry
2013-09-16 11:23:44 +02:00
---
2013-11-12 16:59:12 +02:00
Pull requests welcome. View `registry.json` to see what is currently in the registry.
2013-09-16 11:23:44 +02:00
2013-11-12 17:13:31 +02:00
All registry entries are managed through Github, moderated by the registry maintainers.
2013-09-27 10:16:16 +02:00
2013-11-12 17:13:31 +02:00
What it does
2013-09-16 11:23:44 +02:00
---
2013-11-12 17:13:31 +02:00
### 1. Endpoint Mappings (registry.json)
2013-09-16 11:23:44 +02:00
2013-11-12 17:13:31 +02:00
Modules are served from _endpoint servers_. Endpoints include `github:`, `npm:` and `cdnjs:`, and anyone can submit a new endpoint, provided it meets certain requirements.
2013-09-16 11:23:44 +02:00
2013-11-12 17:13:31 +02:00
If I want to load Twitter Bootstrap with the [JSPM loader](https://github.com/jspm/jspm-loader), I would write the following:
2013-09-16 11:23:44 +02:00
2013-11-12 17:13:31 +02:00
```javascript
jspm.import('github:twbs/bootstrap@3.0/js/bootstrap');
```
2013-09-16 11:23:44 +02:00
2013-11-12 17:13:31 +02:00
The registry simply remembers the `github:twbs/bootstrap` part, allowing the shortcut form:
```javascript
jspm.import('bootstrap@3.0/js/bootstrap');
```
Anyone can submit a new endpoint server to use, simply provide a pull request to `endpoints.json`.
### 2. Package.json Overrides (package_overrides)
The registry also provides a service for overriding the `package.json` of existing repos.
This is because JSPM uses the `package.json` for modular package configuration, including:
* Setting the main entry point (`main`)
* Shim config for globals (`shim`)
* Auto-enabling minification (`buildOptions.uglify`)
In this way, the right package options can make any library play well with JSPM, without needing any manual configuration at all.
Read more about [configuring libraries for JSPM](https://github.com/jspm/registry/wiki/) in the wiki.