<commit_before>---
layout: default
title: Download
---

## Download Leaflet

Besides the library itself, the download package contains full source
code, unit tests, files for debugging and a build system. The production
files (included the same way as in the code above) are in the `dist`
folder.

[Download Leaflet 0.3.1 stable](https://github.com/CloudMade/Leaflet/zipball/v0.3.1) (February 14, 2012)<br />
[Download Leaflet 0.4 master](http://github.com/CloudMade/Leaflet/zipball/master) (in-progress version)

[View Changelog](https://github.com/CloudMade/Leaflet/blob/master/CHANGELOG.md)

### Using a Hosted Version of Leaflet

The latest stable release of Leaflet is hosted on a CDN — to start using
it straight away, place this code in the `head` section of your HTML:

    <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" />
    <!--[if lte IE 8]>
        <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.ie.css" />
    <![endif]-->

    <script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script>

### Building a Custom Version of Leaflet

Open `build/build.html` page from the download package, check the
components you want to see in your build and then follow the
instructions there.<commit_msg>improve download page<commit_after>---
layout: default
title: Download
---

## Download Leaflet

Besides the library itself, the download package contains full source
code, unit tests, files for debugging and a build system. The production
files (included the same way as in the code above) are in the `dist`
folder.

[Download Leaflet 0.3.1 stable](https://github.com/CloudMade/Leaflet/zipball/v0.3.1) (February 14, 2012)<br />
[Download Leaflet 0.4 master](http://github.com/CloudMade/Leaflet/zipball/master) (in-progress version)

[View Changelog](https://github.com/CloudMade/Leaflet/blob/master/CHANGELOG.md)

### Using a Hosted Version of Leaflet

The latest stable release of Leaflet is hosted on a CDN — to start using
it straight away, place this code in the `head` section of your HTML:

    <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" />
    <!--[if lte IE 8]>
        <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.ie.css" />
    <![endif]-->

    <script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script>

### Building Leaflet from the Source

Leaflet build system is powered by the [Node.js](http://nodejs.org) platform and Jake, JSHint and UglifyJS libraries, which install easily and work well across all major platforms. Here are the steps to install it:

 1. [Download and install Node](http://nodejs.org)
 2. Run the following commands in the command line:

	<pre><code class="no-highlight">npm install -g jake
npm install jshint
npm install uglify-js
</code></pre>

Now that you have everything installed, run `jake` inside the Leaflet directory. This will check Leaflet source files for JavaScript errors and inconsistencies, and then combine and compress it to the `dist` folder.

### Building a Custom Version of Leaflet

To make a custom build of the library with only the things you need, open `build/build.html` page of the package contents, choose the components (it figures out dependencies for you) and then run the command generated with it.
{'fraction_non_alphanumeric': 0.11517696460707859, 'fraction_numerical': 0.014997000599880024, 'mean_word_length': 4.146604938271605, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 13, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7074555', 'n_tokens_mistral': 1069, 'n_tokens_neox': 995, 'n_words': 382}