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

hanging-gardens

v2.0.7

Published

A JavaScript project structure for NoRIA webpages.

Downloads

40

Readme

Hanging Gardens

A JavaScript project structure for NoRIA webpages.

Philosophy

A lot of effort is put in making JavaScript based RIA development easier. This is a good thing for RIAs. But NonRIA development, development of regular webpages, still feels like we are stuck in 1995. Sure, we have great libraries like jQuery and MooTools but we still treat our .js files like a bunch of hacks. I don't like hacks so I decided to make something that encourages us, developers, to start taking JavaScript coding serious. This was the birth of Hanging Gardens. Hanging Gardens provides an infrastructure to load js code (like you would load Ruby or PHP code) and it turns many small (and well structured) js files into one (often huge) file. This file can then be further optimized by Googles Closure Compiler or JSMin.

How does it work

A new Hanging Gardens project contains four directories (behaviours, helpers, widgets and lib) and a package.json file. Here is an explanation of what should go in each directory or file.

  • behaviours: contains files with code that makes a webpage or parts thereof behave in a certain way. Think of these as controllers (as in MVC).
  • helpers: contains files with code that you need to use often in many different files.
  • widgets: contains files with code for reusable components, like a sortable table for example.
  • lib: contains files with code that doesn't fit in any of the other directories.
  • package.json: is a CommonJS/Package file which is compatible with the npm package manager.

Take a look at the examples for more information.

Installation

Make sure you have Node.js and NPM installed (on OSX: brew install npm).

npm install hanging-gardens -g

Next, make sure you have Yuicompressor installed

brew install yuicompressor

Building the example

This will build a package.js file.

git clone git://github.com/fd/hanging_gardens.js.git
cd hanging_gardens.js
garden examples/hello-world-js/package.json
# or
garden examples/hello-world-coffee/package.json

The package.js file

The package.js file specifies the project dependencies and how the project files should be processed.

Format

{ "type"    : "application"           // this enables the extra directories
, "main"    : "./behaviours/index.js" // the main behaviour

// the dependecies
, "dependencies" :
  { "jquery": ">= 1.4.3"
  }
}

How to enable JSLint

In your package.json file add this option:

"lint": true

How to enable YUI Compressor

In your package.json file add this option:

"compression": "yui"

How to use Coffee Script

Just create a .coffee file.