View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Nickolay Platonov > Module-Build-JSAN-Installable > Module::Build::JSAN::Installable



Annotate this POD


New  1
Open  0
View/Report Bugs
Module Version: 0.13   Source  


Module::Build::JSAN::Installable - Build JavaScript distributions for JSAN, which can be installed locally


In Build.PL:

  use Module::Build::JSAN::Installable;

  my $build = Module::Build::JSAN::Installable->new(
      module_name    => 'Foo.Bar',
      license        => 'perl',
      keywords       => [qw(Foo Bar pithyness)],
      requires     => {
          'JSAN'     => 0.10,
          'Baz.Quux' => 0.02,
      build_requires => {
          'Test.Simple' => 0.20,
      static_dir => 'assets',
      docs_markup => 'mmd'


To build, test and install a distribution:

  % perl Build.PL
  % ./Build
  % ./Build test  
  % ./Build install

In Components.js:

        "Kernel" : [
        "Web" : [
            //should be the last        
        "ServerJS" : [
            //should be the last


This is a developer aid for creating JSAN distributions, which can be also installed in the local system. JSAN is the "JavaScript Archive Network," a JavaScript library akin to CPAN. Visit for details.

This module works nearly identically to Module::Build::JSAN, so please refer to its documentation for additional details.


1 ./Build install

This action will install current distribution in your local JSAN library. See below for details.

2 ./Build docs

This action will build a documentation files for this distribution. Default markup for documentation is POD. Alternative markup can be specified with docs_markup configuration parameter (see Synopsis). Currently supported markups: 'pod', 'md' (Markdown via Text::Markdown), 'mmd' (MultiMarkdown via Text::MultiMarkdown).

Resulting documentation files will be placed under /docs directory, categorized by the formats. For 'pod' markup there will be /doc/html, /doc/pod and /doc/text directories. For 'md' and 'mmd' markups there will be /doc/html and /doc/[m]md directories.

For 'md' and 'mmd' markups, its possible to keep the module's documentation in separate file. The file should have the same name as module, with extensions, changed to markup abbreviature. An example:

3 ./Build task [--task_name=foo]

This action will build a specific concatenated version (task) of current distribution. Default task name is 'Core', task name can be specified with --task_name command line option.

Information about tasks is stored in the Components.JS file in the root of distribution. See the Synposys for example of Components.JS.

After concatenation, resulting file is placed on the following path: /lib/Task/Distribution/Name/SampleTask.js, assuming the name of your distribution was Distribution.Name and the task name was SampleTask

4 ./Build test

This action relies on not yet released JSAN::Prove module, stay tuned for further updates.


This module uses concept of local JSAN library, which is organized in the same way as perl library.

The path to the library is resolved in the following order:

1. --install_base command-line argument

2. environment variable JSANLIB

3. Either the first directory in $Config{libspath}, followed with /jsan (probably /usr/local/lib on linux systems) or C:\JSAN (on Windows)

As a convention, it is recommended, that you configure your local web-server that way, that /jsan will point at the /lib subdirectory of your local JSAN library. This way you can access any module from it, with URLs like: '/jsan/Test/Run.js'


Under static files we'll assume any files other than javascript (*.js). Typically those are *.css files and images (*.jpg, *.gif, *.png etc).

All such files should be placed in the "static" directory. Default name for share directory is '/static'. Alternative name can be specified with static_dir configuration parameter (see Synopsis). Static directory can be organized in any way you prefere.

Lets assume you have the following distribution structure:


After building (./Build) it will be processed as:


During installation (./Build install) the whole 'blib' tree along with static files will be installed in your local library.


Nickolay Platonov, <nplatonov at>


Please report any bugs or feature requests to bug-module-build-jsan-installable at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


Examples of installable JSAN distributions

Home of the JavaScript Archive Network.

Joose - Moose for JavaScript

Yet another testing platform for JavaScript


This module is stored in an open repository at the following address:

You can also look for information at:


Thanks to David Wheeler for his excelent Module::Build::JSAN, on top of which this module is built.


Copyright 2009 Nickolay Platonov, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: