npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

connect-dojo

v0.1.6

Published

Connect middleware exposing the Dojo Toolkit

Downloads

48

Readme

Connect middleware exposing the Dojo Toolkit

This Connect middleware transparently download and display Dojo files.

In its simplest form, it takes no argument and the latest stable release is used. Here is a quick example:

var express = require('express');
var serve_static = require('serve-static');
var dojo = require('connect-dojo');
var app = express.createServer();
app.configure(
  app.use(express.bodyParser());
  app.use(express.methodOverride());
  app.use(express.cookieParser());
  app.use(app.router);
  app.use(dojo());
  app.use(serve_static(__dirname + '/public'));
  app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
);
app.listen(3000);

Options

  • method
    Support 'release' (default) and 'git'
  • repository
    Default parent directory where Dojo source code is downloaded
  • version
    Dojo version, currently '1.7.1', apply only to the 'download' method
  • mapping
    Object whose keys are "dojo", "dijit", "dojox" and "util" and values are the directory where to download the source code. May be used conjointly with the "repository" options.

Using a released version of Dojo

Source code is downloaded from the official Dojo website and all the versions present on the website are available. For example to download the version '1.5.0', setup the middleware as:

dojo({ version: '1.7.1' })

Using the git HEAD

If the option 'method' is set to 'git' and the revision option of a dojo project is not defined, the middleware will checkout the HEAD revision. Each Dojo project will be store inside a directory defined by the option 'repository' and named as"git-#{project}-HEAD". Here's how to download the latest from GitHub while preserving working tests:

dojo({ 
  method: 'git',
  repository: __dirname+"../public/dojo",
  mapping:
    dojo: './dojo'
    dijit: './dijit'
    dojox: './dojox'
    util: './util'
});

Using a specific git revision

If the option 'method' is set to 'git' and one of 'dojo_revision', 'dijit_revision', 'dojox_revision' or 'util_revision' is defined, then the middleware to checkout the revision in a specific directory inside the one defined by the option 'repository' and named as "git-${project}-#{revision}".

General note

To prevent multiple application from conflicting, a new directory is created for each released version and git revision. This can lead to a large number of directories as new revisions are setup over time. By default, source code is stored inside the connect-dojo module and it is recommended to define your own directory through the 'repository' option.

Testing

Running the tests can take a long time because of the size of dojo. Using expresso, run the following command by adjusting the '-t' (timeout) argument:

expresso -s -t 10000 test